Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit bdc03ba

Browse files
committed
Output CWD when unable to locate launcher
1 parent 364c964 commit bdc03ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

flox/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
APPDATA = Path(os.getenv('APPDATA'))
3030
FILE_PATH = os.path.dirname(os.path.abspath(__file__))
3131
CURRENT_WORKING_DIR = Path().cwd()
32+
LAUNCHER_NOT_FOUND_MSG = f"Unable to locate Launcher directory\nCurrent working directory: {CURRENT_WORKING_DIR}"
3233

3334

3435
launcher_dir = None
@@ -43,19 +44,19 @@
4344
launcher_name = WOX_DIR_NAME
4445
API = WOX_API
4546
else:
46-
raise FileNotFoundError("Unable to locate Launcher directory")
47+
raise FileNotFoundError(LAUNCHER_NOT_FOUND_MSG)
4748

4849
while True:
4950
if len(path.parts) == 1:
50-
raise FileNotFoundError("Unable to locate Launcher directory")
51+
raise FileNotFoundError(LAUNCHER_NOT_FOUND_MSG)
5152
if path.joinpath('Settings').exists():
5253
USER_DIR = path
5354
if USER_DIR.name == 'UserData':
5455
APP_DIR = USER_DIR.parent
5556
elif str(CURRENT_WORKING_DIR).startswith(str(APPDATA)):
5657
APP_DIR = LOCALAPPDATA.joinpath(launcher_name)
5758
else:
58-
raise FileNotFoundError("Unable to locate Launcher directory")
59+
raise FileNotFoundError(LAUNCHER_NOT_FOUND_MSG)
5960
break
6061

6162
path = path.parent

0 commit comments

Comments
 (0)