# HG changeset patch # User Chris Cannam # Date 1405946920 -3600 # Node ID 948148da3a4607ec493419889c45939774ad6810 # Parent 08769d8e46f0a0360a17503a2afc1b0aeec408ab Make deploy script write appropriate shell script in diff -r 08769d8e46f0 -r 948148da3a46 deploy/osx/deploy.sh --- 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