passepartout-apple/ci/xcode-get-setting.sh
Davide 6e8f10f919
Improve CI and local scripts (#1020)
- Move non-CI scripts to "scripts"
- Use lowercase variables consistently
- Work with relative paths
- Work with environment
- Parametrize Xcode build/version number (move uniq last)
2024-12-17 13:10:43 +01:00

18 lines
390 B
Bash
Executable File

#!/bin/bash
if [[ -z "$1" ]]; then
echo "Path to Xcode project required"
exit 1
fi
if [[ -z "$2" ]]; then
echo "Setting key required"
exit 1
fi
if [[ -z "$3" ]]; then
echo "Setting regex required"
exit 1
fi
xcodeproj="$1"
setting_key="$2"
setting_pattern="$3"
grep $setting_key $xcodeproj | sed -E "s/^.*${setting_key} = ${setting_pattern};/\1/" | uniq | tr -d '\n'