mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
cmdeploy: test if ini was overwritten with --force2
This commit is contained in:
@@ -47,10 +47,11 @@ def init_cmd(args, out):
|
||||
if args.inipath.exists():
|
||||
if not args.recreate_ini:
|
||||
out.green(f"[WARNING] Path exists, not modifying: {inipath}")
|
||||
return 0
|
||||
return 1
|
||||
else:
|
||||
out.yellow(f"[WARNING] Force argument was provided, deleting config file: {inipath}")
|
||||
inipath.unlink()
|
||||
return 0
|
||||
|
||||
write_initial_config(inipath, mail_domain, overrides={})
|
||||
out.green(f"created config file for {mail_domain} in {inipath}")
|
||||
|
||||
@@ -27,3 +27,6 @@ class TestCmdline:
|
||||
assert main(["init", "chat.example.org"]) == 1
|
||||
out, err = capsys.readouterr()
|
||||
assert "path exists" in out.lower()
|
||||
assert main(["init", "chat.example.org", "--force"]) == 0
|
||||
out, err = capsys.readouterr()
|
||||
assert "deleting config file" in out.lower()
|
||||
|
||||
Reference in New Issue
Block a user