From 94a94a84a2f91a5cc4eba24466254f171fe9bac4 Mon Sep 17 00:00:00 2001 From: Cody Date: Sat, 14 Jul 2018 19:16:55 -0400 Subject: [PATCH] Check for unzip It's too late to find out unzip isn't installed after already downloading the zip. Let's add a quick check to catch this error at the get-go. --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index dcc70c0..afb92d3 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,11 @@ #!/bin/sh +# check for unzip before we continue +if [ ! "$(command -v unzip)" ]; then + echo 'unzip is required but was not found. Install unzip first and then run this script again.' >&2 + exit 1 +fi + _fetch_sources(){ wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip if [ ! -d ~/.nano/ ] @@ -8,7 +14,6 @@ _fetch_sources(){ fi cd ~/.nano/ || exit - unzip -o "/tmp/nanorc.zip" mv nanorc-master/* ./ rm -rf nanorc-master