fix(ios): shell script quotes

This commit is contained in:
jahorton 2020-03-09 08:29:41 +07:00
parent c161fade8e
commit c7df79e00f
3 changed files with 9 additions and 9 deletions

View file

@ -1266,7 +1266,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". $KEYMAN_ROOT/resources/build/xcode-utils.sh\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
shellScript = ". \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
};
/* End PBXShellScriptBuildPhase section */

View file

@ -974,7 +974,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". $KEYMAN_ROOT/resources/build/xcode-utils.sh\n\n# Calls resource script to update build products' versioning.\n# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display\nphaseSetBundleVersions true\n\n# Also updates the version string for Settings\nsetSettingsBundleVersion\n";
shellScript = ". \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\n# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display\nphaseSetBundleVersions true\n\n# Also updates the version string for Settings\nsetSettingsBundleVersion\n";
showEnvVarsInLog = 0;
};
CED3CFDA240E49DF001540A1 /* ShellScript */ = {
@ -992,7 +992,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = ". $KEYMAN_ROOT/resources/build/xcode-utils.sh\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
shellScript = ". \"$KEYMAN_ROOT/resources/build/xcode-utils.sh\"\n\n# Calls resource script to update build products' versioning.\nphaseSetBundleVersions\n";
};
/* End PBXShellScriptBuildPhase section */

View file

@ -9,17 +9,17 @@
# for its documentation in this matter.
function phaseSetBundleVersions() {
if [[ $# -gt 0 ]]; then
TAGGED=$1
TAGGED="$1" # Should be just `true`, unless someone gets 'creative' later. But we compare against `true`.
else
TAGGED=false
fi
# For command-line builds, VERSION and VERSION_WITH_TAG) are forwarded through xcodebuild.
if [ -z $VERSION ]; then
if [ -z "${VERSION:-}" ]; then
# We're not a command-line build... so we'll need to retrieve these values ourselves with ./build-utils.sh.
# Note that this script's process will not have access to TC environment variables, but that's fine for
# local builds triggered through Xcode's UI, which aren't part of our CI processes.
. $KEYMAN_ROOT/resources/build/build-utils.sh
. "$KEYMAN_ROOT/resources/build/build-utils.sh"
echo "UI build - fetching version from repository:"
echo " Plain: $VERSION"
echo " Tagged: $VERSION_WITH_TAG"
@ -50,11 +50,11 @@ function phaseSetBundleVersions() {
# Used by Keyman for iOS to update the human-readable string for its Settings screen.
function setSettingsBundleVersion() {
# For command-line builds, VERSION and VERSION_WITH_TAG) are forwarded through xcodebuild.
if [ -z $VERSION ]; then
if [ -z "${VERSION:-}" ]; then
# We're not a command-line build... so we'll need to retrieve these values ourselves with ./build-utils.sh.
# Note that this script's process will not have access to TC environment variables, but that's fine for
# local builds triggered through Xcode's UI, which aren't part of our CI processes.
. $KEYMAN_ROOT/resources/build/build-utils.sh
."$KEYMAN_ROOT/resources/build/build-utils.sh"
echo "UI build - fetching version from repository:"
echo " Plain: $VERSION"
echo " Tagged: $VERSION_WITH_TAG"
@ -62,7 +62,7 @@ function setSettingsBundleVersion() {
echo "Command-line build - using provided version parameters"
fi
SETTINGS_PLIST=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Settings.bundle/Root.plist
SETTINGS_PLIST="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Settings.bundle/Root.plist"
echo "Setting $VERSION_WITH_TAG for $SETTINGS_PLIST"
# We assume that entry 0 = the version "preference" entry.
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $VERSION_WITH_TAG" "$SETTINGS_PLIST"