-
Notifications
You must be signed in to change notification settings - Fork 0
/
servermap
executable file
·28 lines (25 loc) · 762 Bytes
/
servermap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
argv0=$(echo "$0" | sed -e 's,\\,/,g')
basedir=$(dirname "$(readlink "$0" || echo "$argv0")")
command_exists() {
command -v "$1" >/dev/null 2>&1;
}
if command_exists node; then
if command_exists winpty && test -t 1; then
winpty node "$basedir/servermap.js" "$@"
else
exec node "$basedir/servermap.js" "$@"
fi
ret=$?
# Debian and Ubuntu use "nodejs" as the name of the binary, not "node", so we
# search for that too. See:
# https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907
elif command_exists nodejs; then
exec nodejs "$basedir/servermap.js" "$@"
ret=$?
else
>&2 echo 'This program requires nodejs installed on your system'
ret=1
fi
exit $ret