Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2019-09-24 16:07:17 +0200
committerGitHub <noreply@github.com>2019-09-24 16:07:17 +0200
commitfae0045c74d69834d7f3eab2bb5121972d7c6fdb (patch)
tree52b32c848e4334e0a182e4d158210a186db5ca4b
parent0b59fe245b9d195c9f883fe7ff3d2371e3896fd4 (diff)
parent865d79a2aa1f24eb7c3ed696bcdae809c94a7247 (diff)
Merge pull request #17 from Torxed/experimental
Enhanced the multi-drive prompt a little bit
-rw-r--r--archinstall.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/archinstall.py b/archinstall.py
index 7247eb33..7113629b 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -481,10 +481,15 @@ if __name__ == '__main__':
if not 'ignore-rerun' in args: args['ignore-rerun'] = False
if not 'localtime' in args: args['localtime'] = 'Europe/Stockholm' if args['country'] == 'SE' else 'GMT+0' # TODO: Arbitrary for now
if not 'drive' in args:
- drives = list(harddrives.keys())
+ drives = sorted(list(harddrives.keys()))
if len(drives) > 1 and 'force' not in args and ('default' in args and 'first-drive' not in args):
- raise KeyError("Multiple disks found, --drive=/dev/X not specified (or --force/--first-drive)")
- args['drive'] = sorted(drives)[0] # First drive found
+ for index, drive in enumerate(drives):
+ print(f'{index}: {drive} ({harddrives[drive]})')
+ drive = input('Select one of the above disks (by number): ')
+ if not drive.isdigit():
+ raise KeyError("Multiple disks found, --drive=/dev/X not specified (or --force/--first-drive)")
+ drives = [drives[int(drive)]] # Make sure only the selected drive is in the list of options
+ args['drive'] = drives[0] # First drive found
rerun = args['ignore-rerun']
if args['drive'][0] != '/':