diff --git a/configure.py b/configure.py index 6e77c14..c0d0abd 100755 --- a/configure.py +++ b/configure.py @@ -17,13 +17,20 @@ class Projects(): def __init__(self, config, args): self.args = args - self.project_dir = config['project_dir'] 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): os.makedirs(self.project_dir) try: - with open('projects.yaml') as fh: + with open(self.projects_file) as fh: self.project_config = yaml.safe_load(fh) except FileNotFoundError: logging.error("projects.yaml not found, create it with --update-orders") @@ -87,11 +94,16 @@ class Projects(): project.pull() # 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 + logging.debug("post clone setup") project.post_clone_setup() 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 filler is False: project.harden() diff --git a/project.py b/project.py index b14d341..cf38671 100644 --- a/project.py +++ b/project.py @@ -296,8 +296,6 @@ class Project(): git_utils.fetch_file(url, os.path.join(self.local_dir, "src", diagram_file)) def create_user_config(self): - self.fetch_wokwi_files() - logging.info("creating include file") filename = 'user_config.tcl' with open(os.path.join(self.local_dir, 'src', filename), 'w') as fh: