From b027bade1c88e3b48835e3d6a9525c5bf3d36334 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 29 May 2020 23:43:04 +0200 Subject: [PATCH] [cli] Create EGL Manifest directory if parent exists. --- legendary/cli.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 3d5b43b..94f22ba 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -761,10 +761,14 @@ class LegendaryCLI: if not os.path.exists(egl_path): print('Path is invalid (does not exist)!') exit(1) - egl_path = os.path.join(egl_path, 'drive_c/ProgramData/Epic/EpicGamesLauncher/Data/Manifests') + egl_data_path = os.path.join(egl_path, 'drive_c/ProgramData/Epic/EpicGamesLauncher/Data') + egl_path = os.path.join(egl_data_path, 'Manifests') if not os.path.exists(egl_path): - print('EGL manifests directory does not exist, this may happen if nothing has been installed.') - exit(1) + if not os.path.exists(egl_data_path): + print('Invalid path (wrong directory, WINE prefix, or EGL not installed/launched)') + exit(1) + print('EGL Data path exists but Manifests directory is missing, creating...') + os.makedirs(egl_path) if not os.listdir(egl_path): logger.warning('Folder is empty, this may be fine if nothing has been installed yet.')