From 3e4ee8af1bc1e8d391c3d3ead79d2d1d5a537701 Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Fri, 22 Sep 2023 17:38:04 +0200 Subject: [PATCH] Fix shellcheck issues --- lib/apps/nixos-install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/apps/nixos-install.sh b/lib/apps/nixos-install.sh index 05e1116e..6fde0b61 100644 --- a/lib/apps/nixos-install.sh +++ b/lib/apps/nixos-install.sh @@ -33,7 +33,9 @@ is_nvme_disk() { } get_partition() { - if is_nvme_disk; then + is_nvme="$(is_nvme_disk)" + local is_nvme + if "${is_nvme}"; then echo "${DISK}p${1}" else echo "${DISK}${1}" @@ -141,7 +143,9 @@ install() { ### Pull the trigger -if _read_boolean "Do you want to DELETE ALL PARTITIONS?" N; then +DO_PARTITION="$(_read_boolean "Do you want to DELETE ALL PARTITIONS?" N)" +readonly DO_PARTITION +if "${DO_PARTITION}"; then partition create_volumes create_filesystems @@ -155,7 +159,9 @@ if [[ ${LVM_PV_NUM_ACTIVE} -lt 1 ]]; then decrypt_lvm fi -if _read_boolean "Do you want to INSTALL NixOS now?" N; then +DO_INSTALL="$(_read_boolean "Do you want to INSTALL NixOS now?" N)" +readonly DO_INSTALL +if "${DO_INSTALL}"; then install fi