diff --git a/bin/n b/bin/n index 662025c..c3d362f 100755 --- a/bin/n +++ b/bin/n @@ -14,6 +14,10 @@ which wget > /dev/null && GET="wget -q -O-" # curl support which curl > /dev/null && GET="curl -# -L" +# Ensure we have curl or wget + +test -z "$GET" && abort "curl or wget required" + # # Log the given # @@ -22,6 +26,14 @@ log() { echo "... $@" } +# +# Exit with the given +# + +abort() { + echo "Error: $@" && exit 1 +} + # # Output usage information. #