Ask for a different disk if not found

This commit is contained in:
Manuel Thalmann 2024-06-26 18:13:07 +02:00
parent 9d045f40f0
commit 9844355048

View file

@ -161,8 +161,26 @@
if osDisk && config.devicePath == null then ''
${diskSelector}
''
else
"local ${diskVarName}=${config.devicePath}"}
else ''
local ${diskVarName}=${config.devicePath}
${if osDisk then ''
. ${./../../../scripts/Common/Scripts/is-truthy.sh}
if [ ! -b ${diskVar} ]; then
function fallback() {
echo "Couldn't find the specified disk \"${diskVar}\"."
echo "Do you want to install the OS on another disk?"
local answer
read answer
if isTruthy "$answer"; then
${diskSelector}
else
exit 1
fi
}
fallback;
fi
'' else ""}
''}
${if (!config.wipe) then cleanup else ""}