kibana/bin/kibana-plugin
jasper 6eb9b26d6b [plugin cli] Wrap arguments in quotes to preserve whitespace (#9124)
Backports PR #8945

**Commit 1:**
[plugin cli] Wrap arguments in quotes to preserve whitespace

* Original sha: 18d6e921ef
* Authored by Jonathan Budzenski <jon@jbudz.me> on 2016-11-02T17:28:49Z
2016-11-17 10:48:58 -06:00

24 lines
619 B
Bash
Executable file

#!/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"
test -x "$NODE" || NODE=$(which node)
if [ ! -x "$NODE" ]; then
echo "unable to find usable node.js executable."
exit 1
fi
exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli_plugin" "$@"