mirror of
https://github.com/chatmail/relay.git
synced 2026-05-12 00:54:37 +00:00
Compare commits
2 Commits
docker-dns
...
fix-overwr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0040c1c52 | ||
|
|
ea9f56d6b3 |
@@ -46,11 +46,12 @@ def init_cmd(args, out):
|
|||||||
inipath = args.inipath
|
inipath = args.inipath
|
||||||
if args.inipath.exists():
|
if args.inipath.exists():
|
||||||
if not args.recreate_ini:
|
if not args.recreate_ini:
|
||||||
out.green(f"[WARNING] Path exists, not modifying: {inipath}")
|
print(f"[WARNING] Path exists, not modifying: {inipath}")
|
||||||
return 0
|
return 1
|
||||||
else:
|
else:
|
||||||
out.yellow(f"[WARNING] Force argument was provided, deleting config file: {inipath}")
|
print(f"[WARNING] Force argument was provided, deleting config file: {inipath}")
|
||||||
inipath.unlink()
|
inipath.unlink()
|
||||||
|
return 0
|
||||||
|
|
||||||
write_initial_config(inipath, mail_domain, overrides={})
|
write_initial_config(inipath, mail_domain, overrides={})
|
||||||
out.green(f"created config file for {mail_domain} in {inipath}")
|
out.green(f"created config file for {mail_domain} in {inipath}")
|
||||||
|
|||||||
@@ -27,3 +27,6 @@ class TestCmdline:
|
|||||||
assert main(["init", "chat.example.org"]) == 1
|
assert main(["init", "chat.example.org"]) == 1
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert "path exists" in out.lower()
|
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