mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Fix NODE_PATH issue
This commit is contained in:
parent
ef641fb9c3
commit
3d3e2fd23f
20
bin/resin
20
bin/resin
@ -33,10 +33,20 @@ else
|
||||
unsupported_platform
|
||||
fi
|
||||
|
||||
NODE_PATH="./bin/node/$NODE_BIN"
|
||||
BIN_RESIN=$0
|
||||
|
||||
while [ -L "$BIN_RESIN" ]; do
|
||||
BIN_RESIN=`readlink "$BIN_RESIN"`
|
||||
done
|
||||
|
||||
BIN_DIRECTORY=`dirname $BIN_RESIN`
|
||||
|
||||
NODE_PATH=$BIN_DIRECTORY/node/$NODE_BIN
|
||||
|
||||
if [ ! -x $NODE_PATH ]; then
|
||||
|
||||
echo "$NODE_PATH does not exist"
|
||||
|
||||
# As a last resource, try to use an already available node
|
||||
if command -v node >/dev/null 2>&1; then
|
||||
NODE_PATH="node"
|
||||
@ -45,10 +55,4 @@ if [ ! -x $NODE_PATH ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
BIN_RESIN=$0
|
||||
|
||||
while [ -L "$BIN_RESIN" ]; do
|
||||
BIN_RESIN=`readlink "$BIN_RESIN"`
|
||||
done
|
||||
|
||||
$NODE_PATH "$BIN_RESIN/../../build/app.js" "$@"
|
||||
$NODE_PATH "$BIN_DIRECTORY/../build/app.js" "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user