Skip to content

Commit 865dd51

Browse files
committed
[cli] Fix and cleanup uninstaller wording/handling
Somebody made a little copy-paste mistake there...
1 parent 6536473 commit 865dd51

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

legendary/cli.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,17 +1175,10 @@ def uninstall_game(self, args):
11751175
def _handle_uninstaller(self, igame, yes=False):
11761176
uninstaller = igame.uninstaller
11771177

1178-
print('\nThis game lists the following prerequisites to be installed:')
1179-
print(f'- {" ".join((uninstaller["path"], uninstaller["args"]))}\n')
1180-
1181-
# default to yes
1182-
c = 'y'
1183-
if not yes:
1184-
choice = input('Do you wish to run the uninstaller? ([y]es, [n]o): ')
1185-
if choice:
1186-
c = choice.lower()[0]
1187-
1188-
if c == 'y': # set to installed and launch installation
1178+
print('\nThis game provides the following uninstaller:')
1179+
print(f'- {uninstaller["path"]} {uninstaller["args"]}\n')
1180+
1181+
if yes or get_boolean_choice('Do you wish to run the uninstaller?', default=True):
11891182
logger.info('Running uninstaller...')
11901183
req_path, req_exec = os.path.split(uninstaller['path'])
11911184
work_dir = os.path.join(igame.install_path, req_path)
@@ -1195,8 +1188,6 @@ def _handle_uninstaller(self, igame, yes=False):
11951188
p.wait()
11961189
except Exception as e:
11971190
logger.error(f'Failed to run uninstaller: {e!r}')
1198-
elif c != 'n':
1199-
print('Invalid choice, not running uninstaller...')
12001191

12011192
def verify_game(self, args, print_command=True, repair_mode=False, repair_online=False):
12021193
args.app_name = self._resolve_aliases(args.app_name)

0 commit comments

Comments
 (0)