Mercurial > hg > tony
changeset 379:948148da3a46 tonioni_experiment_july2014
Make deploy script write appropriate shell script in
author | Chris Cannam |
---|---|
date | Mon, 21 Jul 2014 13:48:40 +0100 |
parents | 08769d8e46f0 |
children | 49e38c6a8a47 |
files | deploy/osx/deploy.sh |
diffstat | 1 files changed, 24 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/deploy/osx/deploy.sh Mon Jul 21 13:43:58 2014 +0100 +++ b/deploy/osx/deploy.sh Mon Jul 21 13:48:40 2014 +0100 @@ -5,6 +5,25 @@ # as argument (the target will use $app.app regardless, but we need # to know the source) +#!!! Special args for constructing experimental scripts. Do not merge +#!!! to default branch. +shext="" +if [ "$1" = "--no-sonification" ]; then + shext=".no-sonification" + shift +elif [ "$1" = "--no-spectrogram" ]; then + shext=".no-spectrogram" + shift +elif [ "$1" = "--all-features" ]; then + shext="" + shift +else + echo "Error: Must supply one of --all-features, --no-sonification, --no-spectrogram" + exit 2 +fi + +echo "Shell file extension: $shext" + source="$1" dmg="$2" if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then @@ -25,13 +44,16 @@ if file "$source/Contents/MacOS/$app" | grep -q script; then echo - echo "Executable is already a script, leaving it alone." + echo "Executable is already a script, replacing it." + + cp "deploy/osx/$app.sh$shext" "$source/Contents/MacOS/$app" || exit 1 + chmod +x "$source/Contents/MacOS/$app" else echo echo "Moving aside executable, adding script." mv "$source/Contents/MacOS/$app" "$source/Contents/MacOS/$app.bin" || exit 1 - cp "deploy/osx/$app.sh" "$source/Contents/MacOS/$app" || exit 1 + cp "deploy/osx/$app.sh$shext" "$source/Contents/MacOS/$app" || exit 1 chmod +x "$source/Contents/MacOS/$app" fi