Created
June 4, 2015 18:49
-
-
Save jacaetevha/7c4206d2cfadd54a492c to your computer and use it in GitHub Desktop.
Enhancements to Pharo ZeroConf Bash scripts
This file contains hidden or 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
#!/usr/bin/env bash | |
# some magic to find out the real location of this script dealing with symlinks | |
DIR=`readlink "$0"` || DIR="$0"; | |
DIR=`dirname "$DIR"`; | |
cd "$DIR" | |
DIR=`pwd` | |
cd - > /dev/null | |
# disable parameter expansion to forward all arguments unprocessed to the VM | |
set -f | |
if [[ "$1" = "*.image" ]]; then | |
# run the VM and pass along all arguments as is | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" --headless "$@" | |
elif [[ -e "$DEFAULT_PHARO_IMAGE" ]]; then | |
# use the image specified in DEFAULT_PHARO_IMAGE and then pass along arguments | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" --headless $DEFAULT_PHARO_IMAGE "$@" | |
else | |
# use the default Pharo.image and then pass along arguments | |
image_file="$DIR/Pharo.image" | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" --headless $image_file "$@" | |
fi |
This file contains hidden or 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
#!/usr/bin/env bash | |
# some magic to find out the real location of this script dealing with symlinks | |
DIR=`readlink "$0"` || DIR="$0"; | |
DIR=`dirname "$DIR"`; | |
cd "$DIR" | |
DIR=`pwd` | |
cd - > /dev/null | |
# disable parameter expansion to forward all arguments unprocessed to the VM | |
set -f | |
# run the VM and pass along all arguments as is | |
if [[ "$1" = "*.image" ]]; then | |
# run the VM and pass along all arguments as is | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" "$@" & | |
elif [[ -e "$DEFAULT_PHARO_IMAGE" ]]; then | |
# use the image specified in DEFAULT_PHARO_IMAGE and then pass along arguments | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" $DEFAULT_PHARO_IMAGE "$@" & | |
else | |
# use the default Pharo.image and then pass along arguments | |
image_file="$DIR/Pharo.image" | |
"$DIR"/"pharo-vm/Pharo.app/Contents/MacOS/Pharo" $image_file "$@" & | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry, I got lost (I have the window open but I forget the issue you're referring :P)
dit you submit an issue to http://bugs.pharo.org?