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.
This commit is contained in:
Cody 2018-07-14 19:16:55 -04:00 committed by GitHub
parent c18ba7b651
commit 94a94a84a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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