Mercurial > hg > tony
comparison deploy/osx/deploy.sh @ 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 | 23287f4f521f |
children | 5641917aea9c |
comparison
equal
deleted
inserted
replaced
378:08769d8e46f0 | 379:948148da3a46 |
---|---|
2 | 2 |
3 # Execute this from the top-level directory of the project (the one | 3 # Execute this from the top-level directory of the project (the one |
4 # that contains the .app bundle). Supply the name of the .app bundle | 4 # that contains the .app bundle). Supply the name of the .app bundle |
5 # as argument (the target will use $app.app regardless, but we need | 5 # as argument (the target will use $app.app regardless, but we need |
6 # to know the source) | 6 # to know the source) |
7 | |
8 #!!! Special args for constructing experimental scripts. Do not merge | |
9 #!!! to default branch. | |
10 shext="" | |
11 if [ "$1" = "--no-sonification" ]; then | |
12 shext=".no-sonification" | |
13 shift | |
14 elif [ "$1" = "--no-spectrogram" ]; then | |
15 shext=".no-spectrogram" | |
16 shift | |
17 elif [ "$1" = "--all-features" ]; then | |
18 shext="" | |
19 shift | |
20 else | |
21 echo "Error: Must supply one of --all-features, --no-sonification, --no-spectrogram" | |
22 exit 2 | |
23 fi | |
24 | |
25 echo "Shell file extension: $shext" | |
7 | 26 |
8 source="$1" | 27 source="$1" |
9 dmg="$2" | 28 dmg="$2" |
10 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then | 29 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then |
11 echo "Usage: $0 <source.app> <target-dmg-basename>" | 30 echo "Usage: $0 <source.app> <target-dmg-basename>" |
23 *) echo "Error: Version $version is neither two- nor three-part number" ;; | 42 *) echo "Error: Version $version is neither two- nor three-part number" ;; |
24 esac | 43 esac |
25 | 44 |
26 if file "$source/Contents/MacOS/$app" | grep -q script; then | 45 if file "$source/Contents/MacOS/$app" | grep -q script; then |
27 echo | 46 echo |
28 echo "Executable is already a script, leaving it alone." | 47 echo "Executable is already a script, replacing it." |
48 | |
49 cp "deploy/osx/$app.sh$shext" "$source/Contents/MacOS/$app" || exit 1 | |
50 chmod +x "$source/Contents/MacOS/$app" | |
29 else | 51 else |
30 echo | 52 echo |
31 echo "Moving aside executable, adding script." | 53 echo "Moving aside executable, adding script." |
32 | 54 |
33 mv "$source/Contents/MacOS/$app" "$source/Contents/MacOS/$app.bin" || exit 1 | 55 mv "$source/Contents/MacOS/$app" "$source/Contents/MacOS/$app.bin" || exit 1 |
34 cp "deploy/osx/$app.sh" "$source/Contents/MacOS/$app" || exit 1 | 56 cp "deploy/osx/$app.sh$shext" "$source/Contents/MacOS/$app" || exit 1 |
35 chmod +x "$source/Contents/MacOS/$app" | 57 chmod +x "$source/Contents/MacOS/$app" |
36 fi | 58 fi |
37 | 59 |
38 echo | 60 echo |
39 echo "Copying in plugins from pyin/pyin.dylib and chp/chp.dylib." | 61 echo "Copying in plugins from pyin/pyin.dylib and chp/chp.dylib." |