From 81136ec3686d917b714429d58e1df47cb0e6f575 Mon Sep 17 00:00:00 2001
From: Soispha <soispha@vhack.eu>
Date: Tue, 11 Jul 2023 12:54:00 +0200
Subject: Fix(bootstrap/install): Removed usage of unassigned variable

---
 bootstrap/01_install | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'bootstrap')

diff --git a/bootstrap/01_install b/bootstrap/01_install
index cf6ac1cb..712587d8 100755
--- a/bootstrap/01_install
+++ b/bootstrap/01_install
@@ -52,7 +52,7 @@ ssd_or_hdd="$(cat /sys/block/"$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DI
 case "$ssd_or_hdd" in
     0)
         msg2 "You seem to use a ssd."
-        trim_support=$(lsblk --bytes --json --discard | jq --arg name "$disk" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0')
+        trim_support=$(lsblk --bytes --json --discard | jq --arg name "$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0')
         case $trim_support in
             "true")
                 msg2 "Yay, your ssd supports trim, go on and activate it"
@@ -61,7 +61,7 @@ case "$ssd_or_hdd" in
                 msg2 "Nay, your ssd doesn't support trim"
                 ;;
             *)
-                warning "Your ssd doesn't seem to exists, if this bothers you please open an issue.'"
+                warning "Your ssd doesn't seem to exists, if this bothers you please open an issue."
                 ;;
         esac
         ;;
-- 
cgit 1.4.1