File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import json
6
6
import os
7
- import pathlib
8
7
9
8
import pytest
10
9
@@ -599,7 +598,7 @@ def test_ls_cli(monkeypatch, tmpdir):
599
598
# - directories should be ignored
600
599
# - extensions not covered in VALID_CONFIG_DIR_FILE_EXTENSIONS
601
600
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 ]
603
602
604
603
for filename in filenames :
605
604
location = tmpdir .join ('.tmuxp/{}' .format (filename ))
Original file line number Diff line number Diff line change 10
10
import logging
11
11
import os
12
12
import sys
13
- from pathlib import Path
14
13
15
14
import click
16
15
import kaptan
@@ -931,9 +930,10 @@ def command_convert(config):
931
930
932
931
@cli .command (name = 'ls' , short_help = 'List configured sessions in $HOME/.tmuxp dir.' )
933
932
def 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 :
938
938
continue
939
- print (f . stem )
939
+ print (stem )
You can’t perform that action at this time.
0 commit comments