fix generate-* subcommands from other directories
This commit is contained in:
parent
7a9a39f2fb
commit
67cb69000b
1 changed files with 4 additions and 2 deletions
|
@ -50,7 +50,8 @@ def main() -> None:
|
|||
except KeyboardInterrupt:
|
||||
pass
|
||||
elif args.subcommand == "generate-units":
|
||||
if not args.force and os.path.isfile(args.directory + "/units.yaml"):
|
||||
os.chdir(args.directory)
|
||||
if not args.force and os.path.isfile("units.yaml"):
|
||||
print(
|
||||
"units.yaml already exists, pass --force if you want to overwrite it",
|
||||
file=sys.stderr,
|
||||
|
@ -59,7 +60,8 @@ def main() -> None:
|
|||
else:
|
||||
builder.generate_units()
|
||||
elif args.subcommand == "generate-ingredients":
|
||||
if not args.force and os.path.isfile(args.directory + "/ingredients.yaml"):
|
||||
os.chdir(args.directory)
|
||||
if not args.force and os.path.isfile("ingredients.yaml"):
|
||||
print(
|
||||
"ingredients.yaml already exists, pass --force if you want to overwrite it",
|
||||
file=sys.stderr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue