Refreshing partitions function

This commit is contained in:
Anton Hvornum 2019-12-25 18:42:56 +00:00
parent eb318c24db
commit 2f90c03afd
1 changed files with 4 additions and 1 deletions

View File

@ -778,6 +778,9 @@ def cache_diskpw_on_disk():
with open(args['pwfile'], 'w') as pw:
pw.write(args['password'])
def refresh_partition_list(drive):
args['paritions'] = get_partitions(drive)
if __name__ == '__main__':
update_git() # Breaks and restarts the script if an update was found.
update_drive_list()
@ -836,7 +839,7 @@ if __name__ == '__main__':
close_disks()
format_disk(args['drive'], start=args['start'], end=args['size'])
args['paritions'] = get_partitions(args['drive'])
refresh_partition_list(args['drive'])
print(f'Partitions: (Boot: {list(args["paritions"].keys())[0]})')
if len(args['paritions']) <= 0: