Skip to content

Instantly share code, notes, and snippets.

@jacaetevha
Created June 4, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacaetevha/7c4206d2cfadd54a492c to your computer and use it in GitHub Desktop.
Save jacaetevha/7c4206d2cfadd54a492c to your computer and use it in GitHub Desktop.
Enhancements to Pharo ZeroConf Bash scripts
#!/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
#!/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
@estebanlm
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment