Collect all affected devices
This commit is contained in:
parent
2a8d4dc805
commit
4967a1452c
1 changed files with 8 additions and 3 deletions
|
@ -88,6 +88,11 @@ in
|
||||||
)
|
)
|
||||||
(builtins.attrValues cfg.mounts))
|
(builtins.attrValues cfg.mounts))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
affected = (builtins.map (_: _.deviceVariable) devices) ++
|
||||||
|
(builtins.concatMap
|
||||||
|
(_: builtins.map (_: lib.escapeShellArg _) _.devices)
|
||||||
|
(builtins.attrValues cfg.btrfs.volumes));
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
@ -96,8 +101,8 @@ in
|
||||||
${lib.strings.concatLines (lib.optionals ((builtins.length devices) > 0) [
|
${lib.strings.concatLines (lib.optionals ((builtins.length devices) > 0) [
|
||||||
''echo "$(tput setaf 3)=== WARNING ====$(tput sgr0)"''
|
''echo "$(tput setaf 3)=== WARNING ====$(tput sgr0)"''
|
||||||
(''echo "Continuing this script will alter the partitions of ''
|
(''echo "Continuing this script will alter the partitions of ''
|
||||||
+ (lib.strings.concatStringsSep ", " (builtins.map (_: "${_.deviceVariable}") (lib.lists.init devices)))
|
+ (lib.strings.concatStringsSep ", " (lib.lists.init affected))
|
||||||
+ (if (builtins.length devices) > 1 then " and " else "") + (lib.lists.last devices).deviceVariable + ''"'')
|
+ (if (builtins.length affected) > 1 then " and " else "") + (lib.lists.last affected) + ''"'')
|
||||||
''
|
''
|
||||||
if ! fish ${./fileSystems/confirm.fish} "Are you sure you want to continue?" "n"; then
|
if ! fish ${./fileSystems/confirm.fish} "Are you sure you want to continue?" "n"; then
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue