From fedb542bbb0c7225ade10ab1e9de2c0a15826285 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Fri, 23 Aug 2024 13:43:34 +0100 Subject: [PATCH] Do not error out when seed is calling without a positional argument. Calling `odk.py seed` without any argument results in a crash because the `repo` variable (supposed to hold the name of the repository) is set to None, which is not expected by the Jinja template (it expects a string). When no positional arguments are specified, we set the `repo` variable to `noname` instead, thereby allowing the creation of a full repository with a dummy name instead of causing an error. --- odk/odk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odk/odk.py b/odk/odk.py index 84d832d6..bd5a64e7 100755 --- a/odk/odk.py +++ b/odk/odk.py @@ -996,7 +996,7 @@ def seed(config, clean, outdir, templatedir, dependencies, title, user, source, raise Exception('max one repo; current={}'.format(repo)) repo = repo[0] else: - repo = None + repo = "noname" mg.load_config(config, imports=dependencies, title=title,