mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
handle --test
This commit is contained in:
+15
-3
@@ -17,13 +17,20 @@ class Projects():
|
|||||||
|
|
||||||
def __init__(self, config, args):
|
def __init__(self, config, args):
|
||||||
self.args = args
|
self.args = args
|
||||||
self.project_dir = config['project_dir']
|
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
if args.test:
|
||||||
|
self.projects_file = 'test_projects.yaml'
|
||||||
|
self.project_dir = config['test_project_dir']
|
||||||
|
else:
|
||||||
|
self.projects_file = 'projects.yaml'
|
||||||
|
self.project_dir = config['project_dir']
|
||||||
|
|
||||||
if not os.path.exists(self.project_dir):
|
if not os.path.exists(self.project_dir):
|
||||||
os.makedirs(self.project_dir)
|
os.makedirs(self.project_dir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open('projects.yaml') as fh:
|
with open(self.projects_file) as fh:
|
||||||
self.project_config = yaml.safe_load(fh)
|
self.project_config = yaml.safe_load(fh)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logging.error("projects.yaml not found, create it with --update-orders")
|
logging.error("projects.yaml not found, create it with --update-orders")
|
||||||
@@ -87,11 +94,16 @@ class Projects():
|
|||||||
project.pull()
|
project.pull()
|
||||||
|
|
||||||
# projects should now be installed, so load all the data from the yaml files
|
# projects should now be installed, so load all the data from the yaml files
|
||||||
logging.debug("post clone setup")
|
|
||||||
# fill projects will load from the fill project's directory
|
# fill projects will load from the fill project's directory
|
||||||
|
logging.debug("post clone setup")
|
||||||
project.post_clone_setup()
|
project.post_clone_setup()
|
||||||
logging.debug(project)
|
logging.debug(project)
|
||||||
|
|
||||||
|
# fetch the wokwi source
|
||||||
|
if args.clone_all:
|
||||||
|
if not project.is_fill() and project.is_wokwi():
|
||||||
|
project.fetch_wokwi_files()
|
||||||
|
|
||||||
if args.harden:
|
if args.harden:
|
||||||
if filler is False:
|
if filler is False:
|
||||||
project.harden()
|
project.harden()
|
||||||
|
|||||||
@@ -296,8 +296,6 @@ class Project():
|
|||||||
git_utils.fetch_file(url, os.path.join(self.local_dir, "src", diagram_file))
|
git_utils.fetch_file(url, os.path.join(self.local_dir, "src", diagram_file))
|
||||||
|
|
||||||
def create_user_config(self):
|
def create_user_config(self):
|
||||||
self.fetch_wokwi_files()
|
|
||||||
|
|
||||||
logging.info("creating include file")
|
logging.info("creating include file")
|
||||||
filename = 'user_config.tcl'
|
filename = 'user_config.tcl'
|
||||||
with open(os.path.join(self.local_dir, 'src', filename), 'w') as fh:
|
with open(os.path.join(self.local_dir, 'src', filename), 'w') as fh:
|
||||||
|
|||||||
Reference in New Issue
Block a user