File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 44
55import json
66import os
7- import pathlib
87
98import pytest
109
@@ -599,7 +598,7 @@ def test_ls_cli(monkeypatch, tmpdir):
599598 # - directories should be ignored
600599 # - extensions not covered in VALID_CONFIG_DIR_FILE_EXTENSIONS
601600 ignored_filenames = ['.git/' , '.gitignore/' , 'session_4.txt' ]
602- stems = [pathlib . PurePath (f ). stem for f in filenames if f not in ignored_filenames ]
601+ stems = [os . path . splitext (f )[ 0 ] for f in filenames if f not in ignored_filenames ]
603602
604603 for filename in filenames :
605604 location = tmpdir .join ('.tmuxp/{}' .format (filename ))
Original file line number Diff line number Diff line change 1010import logging
1111import os
1212import sys
13- from pathlib import Path
1413
1514import click
1615import kaptan
@@ -931,9 +930,10 @@ def command_convert(config):
931930
932931@cli .command (name = 'ls' , short_help = 'List configured sessions in $HOME/.tmuxp dir.' )
933932def command_ls ():
934- tmuxp_dir = Path .home () / '.tmuxp'
935- if tmuxp_dir .exists () and tmuxp_dir .is_dir ():
936- for f in sorted (tmuxp_dir .iterdir ()):
937- if f .is_dir () or f .suffix not in VALID_CONFIG_DIR_FILE_EXTENSIONS :
933+ tmuxp_dir = get_config_dir ()
934+ if os .path .exists (tmuxp_dir ) and os .path .isdir (tmuxp_dir ):
935+ for f in sorted (os .listdir (tmuxp_dir )):
936+ stem , ext = os .path .splitext (f )
937+ if os .path .isdir (f ) or ext not in VALID_CONFIG_DIR_FILE_EXTENSIONS :
938938 continue
939- print (f . stem )
939+ print (stem )
You can’t perform that action at this time.
0 commit comments