Created
December 17, 2021 12:27
-
-
Save sammachin/2e42b880d94dbb3f9c6eeae334f890b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launches a Node-RED Instance using the current path as users and nodes dir but using the global settings.js in ~/.node-red | |
location=$PWD | |
echo $location | |
openBrowser() { | |
sleep 2 | |
open http://127.0.0.1:1880$1 | |
} | |
if [[ -f $location"/settings.js" ]] | |
then | |
settingsFile=$location"/settings.js" | |
editorPath=`echo "var settings=require('./settings.js'); console.log(settings.httpAdminRoot||'/')" | node` | |
else | |
settingsFile=~/.node-red/settings.js | |
editorPath=`echo "var settings=require('/Users/smachin/.node-red/settings.js'); console.log(settings.httpAdminRoot||'/')" | node` | |
fi | |
openBrowser $editorPath & | |
node-red --userDir $location --nodesDir $location"/nodes" --settings $settingsFile $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment