|
3 | 3 | # Utility script to clean up after a MacVim build. |
4 | 4 |
|
5 | 5 | if [[ $# == 0 ]]; then |
6 | | - echo "Usage: cleanup-after-build <MacVim_app>" |
| 6 | + echo "Usage: cleanup-after-build <MacVim_app> <remove_sparkle>" |
7 | 7 | exit -1 |
8 | 8 | fi |
9 | 9 |
|
10 | 10 | set -e |
11 | 11 |
|
12 | 12 | macvim_path=$1 |
| 13 | +remove_sparkle=$2 |
13 | 14 |
|
14 | | -sparkle_xpcservices_symlink="$macvim_path/Contents/Frameworks/Sparkle.framework/XPCServices" |
15 | | -sparkle_xpcservices="$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/Current/XPCServices" |
| 15 | +if [ "$remove_sparkle" == "1" ]; then |
| 16 | + sparkle_path="$macvim_path/Contents/Frameworks/Sparkle.framework" |
| 17 | + if [ -d "$sparkle_path" ]; then |
| 18 | + # Remove the entire Sparkle folder. Used when --disable-sparkle was set. |
| 19 | + # Using a clean up script is easier because there isn't an easy way to tell |
| 20 | + # Xcode not to link/copy it unless we make another target, or dynamically |
| 21 | + # patch the project file. |
| 22 | + set -x |
| 23 | + rm -rf "$sparkle_path" |
| 24 | + fi |
| 25 | +else |
| 26 | + sparkle_xpcservices_symlink="$macvim_path/Contents/Frameworks/Sparkle.framework/XPCServices" |
| 27 | + sparkle_xpcservices="$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/Current/XPCServices" |
16 | 28 |
|
17 | | -if [ -d "$sparkle_xpcservices" ]; then |
18 | | - # This only happens when building using Sparkle 2. It contains XPC Services |
19 | | - # files which are only necessary for sandboxed apps, and not recommended |
20 | | - # otherwise. See https://sparkle-project.org/documentation/sandboxing/. |
21 | | - set -x |
22 | | - rm -rf "$sparkle_xpcservices" |
23 | | - rm "$sparkle_xpcservices_symlink" |
| 29 | + if [ -d "$sparkle_xpcservices" ]; then |
| 30 | + # This only happens when building using Sparkle 2. It contains XPC Services |
| 31 | + # files which are only necessary for sandboxed apps, and not recommended |
| 32 | + # otherwise. See https://sparkle-project.org/documentation/sandboxing/. |
| 33 | + set -x |
| 34 | + rm -rf "$sparkle_xpcservices" |
| 35 | + rm "$sparkle_xpcservices_symlink" |
| 36 | + fi |
24 | 37 | fi |
0 commit comments