Skip to content

Commit 9a119d3

Browse files
authored
feat: improve build.sh logging and add dry run feature (#15615)
1 parent 65b6f5b commit 9a119d3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ source scripts/check_secrets.sh
108108
# Runs xcodebuild with the given flags, piping output to xcbeautify
109109
# If xcodebuild fails with known error codes, retries once.
110110
function RunXcodebuild() {
111-
echo xcodebuild "$@"
111+
# Print the command in a copy-pasteable format
112+
echo xcodebuild $(printf "%q " "$@")
113+
114+
if [[ -n "${DRY_RUN:-}" ]]; then
115+
echo "DRY_RUN is set. Exiting before build."
116+
return 0
117+
fi
118+
112119
local xcodebuild_args=("$@")
113120
local buildaction="${xcodebuild_args[$# - 1]}" # buildaction is the last arg
114121
local log_filename="xcodebuild-${buildaction}.log"

0 commit comments

Comments
 (0)