From b37f0b357bb2ad7da0d2de311540af5553de96cd Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 23 Feb 2026 06:05:25 -0600 Subject: fix: resolve SC2155 shellcheck warnings in custom/lib/ Declare and assign local variables separately to avoid masking return values from command substitutions. --- custom/lib/common.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'custom/lib/common.sh') diff --git a/custom/lib/common.sh b/custom/lib/common.sh index 3af5707..0f02e37 100644 --- a/custom/lib/common.sh +++ b/custom/lib/common.sh @@ -31,7 +31,8 @@ prompt() { echo -e "${BLUE}$1${NC}"; } # Log to file if LOG_FILE is set log() { - local msg="[$(date +'%Y-%m-%d %H:%M:%S')] $1" + local msg + msg="[$(date +'%Y-%m-%d %H:%M:%S')] $1" if [[ -n "$LOG_FILE" ]]; then echo "$msg" >> "$LOG_FILE" fi @@ -162,8 +163,10 @@ list_available_disks() { for disk in /dev/nvme[0-9]n[0-9] /dev/sd[a-z] /dev/vd[a-z]; do [[ -b "$disk" ]] || continue disk_in_use "$disk" && continue - local size=$(get_disk_size "$disk") - local model=$(get_disk_model "$disk") + local size + size=$(get_disk_size "$disk") + local model + model=$(get_disk_model "$disk") disks+=("$disk ($size, $model)") done printf '%s\n' "${disks[@]}" -- cgit v1.2.3