- shellScript = "INFO_PLIST=\"${TARGET_BUILD_DIR}\"/\"${INFOPLIST_PATH}\"\n\n# Get the GIT hashes\nsearchOpsApp=$(git rev-parse --short HEAD)\nsearchOps=$(git -C ../SearchOps rev-parse --short HEAD)\n\necho $searchOpsApp\necho $searchOps\n\n### App logic\n\n# Query and save the value; suppress any error message, if key not found.\nvalueApp=$(/usr/libexec/PlistBuddy -c 'print :GitCommitHashApp' \"${INFO_PLIST}\" 2>/dev/null)\n\n# Check if value is empty\nif [ -z \"$valueApp\" ] \nthen\n /usr/libexec/PlistBuddy -c \"Add :GitCommitHashApp string\" \"${INFO_PLIST}\"\nfi\n\n/usr/libexec/PlistBuddy -c \"Set :GitCommitHashApp `echo $searchOpsApp`\" \"${INFO_PLIST}\"\n\n### Business Logic\n\n# Query and save the value; suppress any error message, if key not found.\nvalue=$(/usr/libexec/PlistBuddy -c 'print :GitCommitHash' \"${INFO_PLIST}\" 2>/dev/null)\n\n# Check if value is empty\nif [ -z \"$value\" ] \nthen\n /usr/libexec/PlistBuddy -c \"Add :GitCommitHash string\" \"${INFO_PLIST}\"\nfi\n\n/usr/libexec/PlistBuddy -c \"Set :GitCommitHash `echo $searchOps`\" \"${INFO_PLIST}\"\n";
0 commit comments