Skip to content

Commit 0c1cc1e

Browse files
committed
Update tmuxp/cli.py
1 parent 4913143 commit 0c1cc1e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tmuxp/cli.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1186,10 +1186,13 @@ def command_convert(confirmed, config):
11861186
"""Convert a tmuxp config between JSON and YAML."""
11871187

11881188
_, ext = os.path.splitext(config)
1189-
if 'json' in ext:
1189+
ext = ext.lower()
1190+
if ext == '.json':
11901191
to_filetype = 'yaml'
1191-
elif 'yaml' in ext:
1192+
elif ext in ['.yaml', '.yml']:
11921193
to_filetype = 'json'
1194+
else:
1195+
raise click.BadParameter('Unknown filetype: %s (valid: [.json, .yaml, .yml])' % (ext, ))
11931196

11941197
configparser = kaptan.Kaptan()
11951198
configparser.import_config(config)

0 commit comments

Comments
 (0)