mirror of
https://github.com/nix-community/disko.git
synced 2024-11-12 18:15:46 +03:00
Fix read shellcheck warning SC2162
Use `-r` to avoid mangling backslashes, use `IFS=` to not discard leading and trailing whitespace.
This commit is contained in:
parent
196a5deeea
commit
4122a18340
@ -108,9 +108,9 @@ in
|
|||||||
set +x
|
set +x
|
||||||
askPassword() {
|
askPassword() {
|
||||||
echo "Enter password for ${config.device}: "
|
echo "Enter password for ${config.device}: "
|
||||||
read -s password
|
IFS= read -r -s password
|
||||||
echo "Enter password for ${config.device} again to be safe: "
|
echo "Enter password for ${config.device} again to be safe: "
|
||||||
read -s password_check
|
IFS= read -r -s password_check
|
||||||
export password
|
export password
|
||||||
[ "$password" = "$password_check" ]
|
[ "$password" = "$password_check" ]
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ in
|
|||||||
${lib.optionalString config.askPassword ''
|
${lib.optionalString config.askPassword ''
|
||||||
set +x
|
set +x
|
||||||
echo "Enter password for ${config.device}"
|
echo "Enter password for ${config.device}"
|
||||||
read -s password
|
IFS= read -r -s password
|
||||||
export password
|
export password
|
||||||
set -x
|
set -x
|
||||||
''}
|
''}
|
||||||
|
Loading…
Reference in New Issue
Block a user