Skip to content

Commit 06ccba3

Browse files
committed
feat: if no name for mamonsu conf file save it as mamonsu.conf
1 parent 858fbee commit 06ccba3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mamonsu/lib/runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ def quit_handler(_signo=None, _stack_frame=None):
110110
if len(commands) == 2:
111111
commands.append('postgrespro.conf')
112112
print('Configuration file for mamonsu have been saved in postgrespro.conf file')
113+
# if no name for conf, save to mamonsu.conf
114+
if commands[2].rfind("/") == len(commands[2]) - 1:
115+
commands[2] = commands[2][:-1] + "/mamonsu.conf"
113116
with open(commands[2], 'w') as fd:
114117
cfg.config.write(fd)
115118
sys.exit(0)

0 commit comments

Comments
 (0)