diff --git a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes index 1d97b886d3..bc27ae3233 100755 --- a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes +++ b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes @@ -4,6 +4,10 @@ set -euo pipefail export CAPSULE_CACHE_DIR=cache +# Allow the script to be run from outside the nodes directory. +basedir=$( dirname "$0" ) +cd "$basedir" + if which osascript >/dev/null; then # MacOS X: open each node in a in new tab. first=true @@ -15,13 +19,12 @@ if which osascript >/dev/null; then script="$script tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down delay 0.5 - do script \"cd $rootdir/$dir; java -jar JAR_NAME; exit\" in window 1" + do script \"cd $rootdir/$dir; java -jar JAR_NAME && exit\" in window 1" first=false fi done script="$script end tell" - echo "$script" osascript -e "$script" else # Some other UNIX, probably Linux