mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
handle missing extra_projects.yaml
This commit is contained in:
@@ -21,8 +21,12 @@ class Orders():
|
|||||||
self.orders = sorted(orders, key=lambda d: d['time'])
|
self.orders = sorted(orders, key=lambda d: d['time'])
|
||||||
|
|
||||||
def add_extra_project(self, git_url):
|
def add_extra_project(self, git_url):
|
||||||
|
try:
|
||||||
with open(self.config['extra_projects']) as fh:
|
with open(self.config['extra_projects']) as fh:
|
||||||
config = yaml.safe_load(fh)
|
config = yaml.safe_load(fh)
|
||||||
|
except FileNotFoundError as e:
|
||||||
|
config = []
|
||||||
|
|
||||||
config.append({'project': {'url' : git_url, 'timestamp' : time.time()}})
|
config.append({'project': {'url' : git_url, 'timestamp' : time.time()}})
|
||||||
with open(self.config['extra_projects'], 'w') as fh:
|
with open(self.config['extra_projects'], 'w') as fh:
|
||||||
yaml.safe_dump(config, fh)
|
yaml.safe_dump(config, fh)
|
||||||
|
|||||||
Reference in New Issue
Block a user