Skip to content

Commit 9e3b36c

Browse files
committed
Ignore directories, files not covered in home dir
1 parent e453ce8 commit 9e3b36c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tmuxp/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
logger = logging.getLogger(__name__)
2929

30+
VALID_CONFIG_DIR_FILE_EXTENSIONS = ['.yaml', '.yml', '.json']
31+
3032

3133
def get_cwd():
3234
return os.getcwd()
@@ -327,7 +329,7 @@ def scan_config(config, config_dir=None):
327329
x
328330
for x in [
329331
'%s%s' % (join(config_dir, config), ext)
330-
for ext in ['.yaml', '.yml', '.json']
332+
for ext in VALID_CONFIG_DIR_FILE_EXTENSIONS
331333
]
332334
if exists(x)
333335
]
@@ -932,4 +934,6 @@ def command_ls():
932934
tmuxp_dir = Path.home() / '.tmuxp'
933935
if tmuxp_dir.exists() and tmuxp_dir.is_dir():
934936
for f in sorted(tmuxp_dir.iterdir()):
937+
if f.is_dir() or f.suffix not in VALID_CONFIG_DIR_FILE_EXTENSIONS:
938+
continue
935939
print(f.stem)

0 commit comments

Comments
 (0)