mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
bin: Use command
to check for commands
`command` is more idiomatic than `hash`. (Also, `hash` has side effects.)
This commit is contained in:
parent
8e8b75be6c
commit
a87a9bb63b
2 changed files with 9 additions and 5 deletions
|
@ -8,6 +8,8 @@ REQUIRED_NODE_MINOR=13
|
|||
REQUIRED_NPM_MAJOR=5
|
||||
REQUIRED_NPM_MINOR=5
|
||||
|
||||
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
||||
|
||||
require_minimal_version() {
|
||||
PROGRAM_LABEL="$1"
|
||||
VERSION_STRING="$2"
|
||||
|
@ -58,13 +60,13 @@ fi
|
|||
|
||||
# Is node installed?
|
||||
# Not checking io.js, default installation creates a symbolic link to node
|
||||
hash node > /dev/null 2>&1 || {
|
||||
is_cmd node || {
|
||||
echo "Please install node.js ( https://nodejs.org )" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Is npm installed?
|
||||
hash npm > /dev/null 2>&1 || {
|
||||
is_cmd npm || {
|
||||
echo "Please install npm ( https://npmjs.org )" >&2
|
||||
exit 1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue