From d3ec25c95ca4b3b4bb992abddc502a6e53266096 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Wed, 10 Mar 2021 18:48:45 -0800 Subject: [PATCH] if then (fixes #2067) --- modules/clone.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/clone.sh b/modules/clone.sh index b2ddfd195..334b6d44b 100644 --- a/modules/clone.sh +++ b/modules/clone.sh @@ -4,12 +4,13 @@ function clone { checkroot checkargn $# 1 argument="$1" + path="fdisk -l | grep -o '^/dev/sd[a-z]' | sort -u" case $argument in "detect") - if [ -n fdisk -l | grep -o '^/dev/sd[a-z]' | sort -u ]; then - fdisk -l | grep -o '^/dev/sd[a-z]' | sort -u + if [ -n $path ]; then + echo $path else echo "Error: Could not detect any devices. Try plugging your device into a different slot."