Skip to content

Commit

Permalink
[cli] Fix and cleanup uninstaller wording/handling
Browse files Browse the repository at this point in the history
Somebody made a little copy-paste mistake there...
  • Loading branch information
derrod committed Jun 17, 2023
1 parent 6536473 commit 865dd51
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions legendary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,17 +1175,10 @@ def uninstall_game(self, args):
def _handle_uninstaller(self, igame, yes=False):
uninstaller = igame.uninstaller

print('\nThis game lists the following prerequisites to be installed:')
print(f'- {" ".join((uninstaller["path"], uninstaller["args"]))}\n')

# default to yes
c = 'y'
if not yes:
choice = input('Do you wish to run the uninstaller? ([y]es, [n]o): ')
if choice:
c = choice.lower()[0]

if c == 'y': # set to installed and launch installation
print('\nThis game provides the following uninstaller:')
print(f'- {uninstaller["path"]} {uninstaller["args"]}\n')

if yes or get_boolean_choice('Do you wish to run the uninstaller?', default=True):
logger.info('Running uninstaller...')
req_path, req_exec = os.path.split(uninstaller['path'])
work_dir = os.path.join(igame.install_path, req_path)
Expand All @@ -1195,8 +1188,6 @@ def _handle_uninstaller(self, igame, yes=False):
p.wait()
except Exception as e:
logger.error(f'Failed to run uninstaller: {e!r}')
elif c != 'n':
print('Invalid choice, not running uninstaller...')

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

0 comments on commit 865dd51

Please sign in to comment.