UI nit: remove unnecessary newline when prompting user for password

This commit is contained in:
Jeremy Fleischman authored and lassulus committed 2025-04-18 01:42:02 +00:00
1 parent 76c0a6dba3
commit 51d33bbb7f
1 file changed
+11 -4
+11 -4
View File
@@ -132,13 +132,20 @@ in
default = ''
if ! blkid "${config.device}" >/dev/null || ! (blkid "${config.device}" -o export | grep -q '^TYPE='); then
${lib.optionalString config.askPassword ''
promptSecret() {
prompt=$1
var=$2
echo -n "$prompt"
IFS= read -r -s "$var"
echo
}
askPassword() {
if [ -z ''${IN_DISKO_TEST+x} ]; then
set +x
echo "Enter password for ${config.device}: "
IFS= read -r -s password
echo "Enter password for ${config.device} again to be safe: "
IFS= read -r -s password_check
promptSecret "Enter password for ${config.device}: " password
promptSecret "Enter password for ${config.device} again to be safe: " password_check
export password
[ "$password" = "$password_check" ]
set -x