Fix issues with files not being in home dir
This commit is contained in:
parent
6892873b1b
commit
a2d8ae96b9
1 changed files with 8 additions and 5 deletions
|
@ -6,12 +6,14 @@ import itertools
|
||||||
import subprocess
|
import subprocess
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
VSCODE_CONFIG_FILE = Path.home().joinpath(".config/Code/storage.json")
|
HOME = Path.home()
|
||||||
|
|
||||||
|
VSCODE_CONFIG_FILE = HOME.joinpath(".config/Code/storage.json")
|
||||||
|
|
||||||
SEARCH_DIRS = [
|
SEARCH_DIRS = [
|
||||||
Path.home().joinpath("Projects"),
|
HOME.joinpath("Projects"),
|
||||||
Path.home().joinpath("Repositories"),
|
HOME.joinpath("Repositories"),
|
||||||
Path.home().joinpath("SR"),
|
HOME.joinpath("SR"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +43,8 @@ def main():
|
||||||
project_paths.remove(Path.home()) # Don't try and edit home dir
|
project_paths.remove(Path.home()) # Don't try and edit home dir
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
project_paths_display = [str(project.relative_to(Path.home())) for project in project_paths]
|
home_dir = str(HOME) + "/"
|
||||||
|
project_paths_display = [str(project).replace(home_dir, "") for project in project_paths]
|
||||||
|
|
||||||
selected_project = subprocess.run(["rofi", "-dmenu", "-no-case-sensitive", "-format", "i"], input="\n".join(project_paths_display).encode(), stdout=subprocess.PIPE)
|
selected_project = subprocess.run(["rofi", "-dmenu", "-no-case-sensitive", "-format", "i"], input="\n".join(project_paths_display).encode(), stdout=subprocess.PIPE)
|
||||||
selected_project.check_returncode()
|
selected_project.check_returncode()
|
||||||
|
|
Loading…
Reference in a new issue