Skip to content

Commit 10d3496

Browse files
committed
Use expanduser for saving and loading files beginning with ~
1 parent 40ece06 commit 10d3496

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tmuxp/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def command_freeze(args):
340340

341341
dest = dest_prompt
342342

343-
dest = os.path.abspath(os.path.relpath(dest))
343+
dest = os.path.abspath(os.path.relpath(os.path.expanduser(dest)))
344344
if prompt_yes_no('Write to %s?' % dest):
345345
buf = open(dest, 'w')
346346
buf.write(newconfig)
@@ -425,7 +425,7 @@ def command_import_teamocil(args):
425425

426426
print(output)
427427
elif args.config:
428-
configfile = os.path.abspath(os.path.relpath(args.config))
428+
configfile = os.path.abspath(os.path.relpath(os.path.expanduser(args.config)))
429429
configparser = kaptan.Kaptan(handler='yaml')
430430

431431
if os.path.exists(configfile):
@@ -466,7 +466,7 @@ def command_import_teamocil(args):
466466

467467
dest = dest_prompt
468468

469-
dest = os.path.abspath(os.path.relpath(dest))
469+
dest = os.path.abspath(os.path.relpath(os.path.expanduser(dest)))
470470
if prompt_yes_no('Write to %s?' % dest):
471471
buf = open(dest, 'w')
472472
buf.write(newconfig)

0 commit comments

Comments
 (0)