Skip to content

Commit 6b3e6bd

Browse files
authored
Merge pull request #18525 from wordpress-mobile/tooling/AppLocalizedString-linter-v2
[Tooling] Improvements on the AppLocalizedString linter
2 parents c04a11c + eb3cf3e commit 6b3e6bd

File tree

2 files changed

+117
-112
lines changed

2 files changed

+117
-112
lines changed

Scripts/BuildPhases/LintAppLocalizedStringsUsage.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ LINTER_EXEC="${LINTER_BUILD_DIR}/$(basename "${SCRIPT_SRC}" .swift)"
88

99
if [ ! -x "${LINTER_EXEC}" ] || ! (shasum -c "${LINTER_EXEC}.shasum" >/dev/null 2>/dev/null); then
1010
echo "Pre-compiling linter script to ${LINTER_EXEC}..."
11-
swiftc -sdk "$(xcrun --sdk macosx --show-sdk-path)" "${SCRIPT_SRC}" -o "${LINTER_EXEC}"
11+
swiftc -O -sdk "$(xcrun --sdk macosx --show-sdk-path)" "${SCRIPT_SRC}" -o "${LINTER_EXEC}"
1212
shasum "${SCRIPT_SRC}" >"${LINTER_EXEC}.shasum"
1313
chmod +x "${LINTER_EXEC}"
1414
echo "Pre-compiled linter script ready"
1515
fi
1616

17-
"$LINTER_EXEC" "${PROJECT_FILE_PATH:-$1}" # "${TARGET_NAME:-$2}"
17+
if [ -z "${PROJECT_FILE_PATH:=${1:-}}" ]; then
18+
echo "error: Please provide the path to the xcodeproj to scan"
19+
exit 1
20+
fi
21+
"$LINTER_EXEC" "${PROJECT_FILE_PATH}" "${@:2}"

0 commit comments

Comments
 (0)