-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsettings_version.sh
More file actions
executable file
·40 lines (32 loc) · 963 Bytes
/
settings_version.sh
File metadata and controls
executable file
·40 lines (32 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
#@AUTHOR Boris Bielik
#@VERSION v1.0
function printHelp {
echo "-p specify name of the plist"
echo "-h, -help show brief help"
exit 0
}
PLIST_PATH=""
while test $# -gt 0; do
case "$1" in
-h|-help)
printHelp
;;
#plist path
-p)
if [ -z "$2" ]; then
echo "No parameter was specified. Exiting..."
exit 1;
fi
PLIST_PATH=$2
shift 2
;;
*)
break;;
esac
done
version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PLIST_PATH}")
version_build="$version (${CURRENT_PROJECT_VERSION})"
settings_bundle_path="$SRCROOT/Covid/Resources/Settings.bundle/Root.plist"
echo "Copying ${version_build} from ${PLIST_PATH} to ${settings_bundle_path}."
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $version_build" "${settings_bundle_path}"