mirror of
https://github.com/tj/n.git
synced 2024-11-22 02:57:32 +01:00
abort
This commit is contained in:
parent
1667a31d61
commit
d3ac35d2f2
12
bin/n
12
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 <msg ...>
|
||||
#
|
||||
@ -22,6 +26,14 @@ log() {
|
||||
echo "... $@"
|
||||
}
|
||||
|
||||
#
|
||||
# Exit with the given <msg ...>
|
||||
#
|
||||
|
||||
abort() {
|
||||
echo "Error: $@" && exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# Output usage information.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user