Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ignore directories, files not covered in home dir
  • Loading branch information
tony committed Jul 10, 2020
commit 9e3b36c2c089b53c7fb8531eade2e57c087df358
6 changes: 5 additions & 1 deletion tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

logger = logging.getLogger(__name__)

VALID_CONFIG_DIR_FILE_EXTENSIONS = ['.yaml', '.yml', '.json']


def get_cwd():
return os.getcwd()
Expand Down Expand Up @@ -327,7 +329,7 @@ def scan_config(config, config_dir=None):
x
for x in [
'%s%s' % (join(config_dir, config), ext)
for ext in ['.yaml', '.yml', '.json']
for ext in VALID_CONFIG_DIR_FILE_EXTENSIONS
]
if exists(x)
]
Expand Down Expand Up @@ -932,4 +934,6 @@ def command_ls():
tmuxp_dir = Path.home() / '.tmuxp'
if tmuxp_dir.exists() and tmuxp_dir.is_dir():
for f in sorted(tmuxp_dir.iterdir()):
if f.is_dir() or f.suffix not in VALID_CONFIG_DIR_FILE_EXTENSIONS:
continue
print(f.stem)