From 61d85b49e690508e3fce18459eeb721e66a4fc5a Mon Sep 17 00:00:00 2001 From: Duncan Bellamy <32509178+a16bitsysop@users.noreply.github.com> Date: Mon, 25 Oct 2021 08:44:49 +0100 Subject: [PATCH] Remove bash dependency (#3216) Change backticks to dollar sign and parentheses --- .../node_modules/node-red/bin/node-red-pi | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/node_modules/node-red/bin/node-red-pi b/packages/node_modules/node-red/bin/node-red-pi index 0e9de3c49..4aedcf018 100755 --- a/packages/node_modules/node-red/bin/node-red-pi +++ b/packages/node_modules/node-red/bin/node-red-pi @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright JS Foundation and other contributors, http://js.foundation # @@ -29,15 +29,16 @@ do done # Find the real location of this script -CURRENT_PATH=`pwd` -SCRIPT_PATH="${BASH_SOURCE[0]}"; +CURRENT_PATH=$(pwd) +SCRIPT_PATH=$(readlink -f "$0") while [ -h "${SCRIPT_PATH}" ]; do - cd "`dirname "${SCRIPT_PATH}"`" - SCRIPT_PATH="$(readlink "`basename "${SCRIPT_PATH}"`")"; + cd "$(dirname "${SCRIPT_PATH}")" || exit 1 + P=$(basename "${SCRIPT_PATH}") + SCRIPT_PATH=$(readlink "${P}") done -cd "`dirname "${SCRIPT_PATH}"`" > /dev/null -SCRIPT_PATH="`pwd`"; -cd $CURRENT_PATH +cd "$(dirname "${SCRIPT_PATH}")" > /dev/null || exit 1 +SCRIPT_PATH=$(pwd) +cd "$CURRENT_PATH" || exit 1 # Run Node-RED -exec /usr/bin/env node $OPTIONS $SCRIPT_PATH/../red.js $ARGS +exec /usr/bin/env node ${OPTIONS} ${SCRIPT_PATH}/../red.js ${ARGS}