2016-03-03 19:44:43 +01:00
|
|
|
#!/bin/sh
|
|
|
|
SCRIPT=$0
|
|
|
|
|
|
|
|
# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
|
|
|
|
while [ -h "$SCRIPT" ] ; do
|
|
|
|
ls=$(ls -ld "$SCRIPT")
|
|
|
|
# Drop everything prior to ->
|
|
|
|
link=$(expr "$ls" : '.*-> \(.*\)$')
|
|
|
|
if expr "$link" : '/.*' > /dev/null; then
|
|
|
|
SCRIPT="$link"
|
|
|
|
else
|
|
|
|
SCRIPT=$(dirname "$SCRIPT")/"$link"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
DIR="$(dirname "${SCRIPT}")/.."
|
|
|
|
NODE="${DIR}/node/bin/node"
|
2017-11-22 19:49:37 +01:00
|
|
|
test -x "$NODE"
|
2016-03-03 19:44:43 +01:00
|
|
|
if [ ! -x "$NODE" ]; then
|
|
|
|
echo "unable to find usable node.js executable."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-08-15 18:30:07 +02:00
|
|
|
NODE_OPTIONS="--no-warnings ${NODE_OPTIONS}" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli_plugin" "$@"
|