Skip to content

Commit 5c6f3ad

Browse files
committed
Update tmuxp/cli.py
1 parent bed8e37 commit 5c6f3ad

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
@@ -1185,10 +1185,13 @@ def command_convert(confirmed, config):
11851185
"""Convert a tmuxp config between JSON and YAML."""
11861186

11871187
_, ext = os.path.splitext(config)
1188-
if 'json' in ext:
1188+
ext = ext.lower()
1189+
if ext == '.json':
11891190
to_filetype = 'yaml'
1190-
elif 'yaml' in ext:
1191+
elif ext in ['.yaml', '.yml']:
11911192
to_filetype = 'json'
1193+
else:
1194+
raise click.BadParameter('Unknown filetype: %s (valid: [.json, .yaml, .yml])' % (ext, ))
11921195

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

0 commit comments

Comments
 (0)