mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
Handled user interruption during the process of moving a game
This commit is contained in:
parent
c96afd76f9
commit
b2e9f6ae81
|
@ -2515,6 +2515,10 @@ class LegendaryCLI:
|
|||
logger.error(f'The target path already contains a folder called "{game_folder}", '
|
||||
f'please remove or rename it first.')
|
||||
return
|
||||
logger.info('This process could be cancelled and reverted by interrupting it with CTRL-C')
|
||||
if not get_boolean_choice(f'Are you sure you wish to move "{igame.title}" from "{old_base}" to "{args.new_path}"?'):
|
||||
print('Aborting...')
|
||||
exit(0)
|
||||
try:
|
||||
total_files, total_chunks = scan_dir(igame.install_path)
|
||||
copied_files = 0
|
||||
|
@ -2567,6 +2571,11 @@ class LegendaryCLI:
|
|||
logger.info(f'Try moving the folder manually to "{new_path}" and running '
|
||||
f'"legendary move {app_name} "{args.new_path}" --skip-move"')
|
||||
return
|
||||
except KeyboardInterrupt:
|
||||
# TODO: Make it resumable
|
||||
shutil.rmtree(new_path)
|
||||
logger.info("The process has been cancelled.")
|
||||
return
|
||||
else:
|
||||
logger.info(f'Not moving, just rewriting legendary metadata...')
|
||||
|
||||
|
|
Loading…
Reference in a new issue