Change shebang, close when curl is not present
This commit is contained in:
parent
9443697295
commit
1e62b03ab0
@ -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/{} <<< "${@}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user