From 48a90285b42d391d44aa32c237accae78a2ffc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bartmi=C5=84ski?= Date: Sun, 8 Dec 2024 22:58:04 +0100 Subject: [PATCH] Test quick fix #1 --- src/sinol_make/commands/init/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sinol_make/commands/init/__init__.py b/src/sinol_make/commands/init/__init__.py index 51f6277b..6c0ef5c9 100644 --- a/src/sinol_make/commands/init/__init__.py +++ b/src/sinol_make/commands/init/__init__.py @@ -37,9 +37,9 @@ def configure_subparser(self, subparser: argparse.ArgumentParser): parser.add_argument('-v', '--verbose', action='store_true') return parser - def download_template(self): - template = self.template[0] - subdir = self.template[1] if len(self.template) > 1 else '' + def download_template(self, template_paths = [DEFAULT_TEMPLATE, DEFAULT_SUBDIR]): + template = template_paths[0] + subdir = template_paths[1] if len(template_paths) > 1 else '' self.used_tmpdir = tempfile.TemporaryDirectory() tmp_dir = self.used_tmpdir.name @@ -95,7 +95,6 @@ def update_task_id(self): def run(self, args: argparse.Namespace): self.task_id = args.task_id self.force = args.force - self.template = args.template self.verbose = args.verbose destination = args.output or self.task_id if not os.path.isabs(destination): @@ -108,7 +107,7 @@ def run(self, args: argparse.Namespace): f"Provide a different task id or directory name, " f"or use the --force flag to overwrite.") try: - self.template_dir = self.download_template() + self.template_dir = self.download_template(args.template) os.chdir(destination)