Prompt for an answer before formatting
This commit is contained in:
parent
5169db7448
commit
50e8cfe705
|
@ -355,10 +355,18 @@
|
||||||
(_: "sudo swapon ${partPath _}")
|
(_: "sudo swapon ${partPath _}")
|
||||||
(builtins.filter (_: _.useSwap) partitions));
|
(builtins.filter (_: _.useSwap) partitions));
|
||||||
in lib.strings.concatLines (
|
in lib.strings.concatLines (
|
||||||
(builtins.map (_: _.deviceScript) disks) ++ lib.optional ((builtins.length disks) > 0) (
|
(builtins.map (_: _.deviceScript) disks) ++ lib.optionals ((builtins.length disks) > 0) [
|
||||||
''echo "Continuing this script will wipe the contents of '' + (
|
". ${./../../../scripts/Common/Scripts/is-truthy.sh}"
|
||||||
|
(''echo "Continuing this script will wipe the contents of '' + (
|
||||||
lib.strings.concatStringsSep ", " (builtins.map (_: "${_.deviceVariable}") (lib.lists.init disks))
|
lib.strings.concatStringsSep ", " (builtins.map (_: "${_.deviceVariable}") (lib.lists.init disks))
|
||||||
) + (if (builtins.length disks) > 1 then " and " else "") + (lib.lists.last disks).deviceVariable + ''"'') ++
|
) + (if (builtins.length disks) > 1 then " and " else "") + (lib.lists.last disks).deviceVariable + ''"'')
|
||||||
|
''read -p "Are you sure you want to continue? [y/n] " answer''
|
||||||
|
''
|
||||||
|
if ! isTruthy "$answer"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
] ++
|
||||||
(builtins.map (_: _.script) disks) ++ [
|
(builtins.map (_: _.script) disks) ++ [
|
||||||
mountScript
|
mountScript
|
||||||
swapScript
|
swapScript
|
||||||
|
|
Loading…
Reference in a new issue