Skip to content

Commit

Permalink
Do not error out when seed is calling without a positional argument.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gouttegd committed Aug 23, 2024
1 parent 7da6b03 commit fedb542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odk/odk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fedb542

Please sign in to comment.