Minor: couple more usability tweaks to the runnodes script

This commit is contained in:
Mike Hearn 2016-11-17 18:49:40 +01:00
parent 81d6195a07
commit 010112e44e

View File

@ -4,6 +4,10 @@
set -euo pipefail set -euo pipefail
export CAPSULE_CACHE_DIR=cache 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 if which osascript >/dev/null; then
# MacOS X: open each node in a in new tab. # MacOS X: open each node in a in new tab.
first=true first=true
@ -15,13 +19,12 @@ if which osascript >/dev/null; then
script="$script script="$script
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down
delay 0.5 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 first=false
fi fi
done done
script="$script script="$script
end tell" end tell"
echo "$script"
osascript -e "$script" osascript -e "$script"
else else
# Some other UNIX, probably Linux # Some other UNIX, probably Linux