Change shebang, close when curl is not present

This commit is contained in:
Eric Torres 2018-12-15 21:24:42 -08:00
parent 9443697295
commit 1e62b03ab0

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/bash
# Obtain a weather forecast # Obtain a weather forecast
printHelp() { printHelp() {
@ -32,6 +32,7 @@ while true; do
esac esac
done done
[[ ! -x '/usr/bin/curl' ]] && echo 'curl is required for this script' && exit 1
[[ -z "${@}" ]] && echo "Please enter a location" >&2 && exit 1 [[ -z "${@}" ]] && echo "Please enter a location" >&2 && exit 1
xargs --no-run-if-empty -I {} curl wttr.in/{} <<< "${@}" xargs --no-run-if-empty -I {} curl wttr.in/{} <<< "${@}"