From d578d18db68f2e872875bb24fe61a4437dd3ef69 Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Sun, 24 May 2026 06:26:06 -0700 Subject: [PATCH] fix(codegen): log error message instead of executing it in script_phases.sh The error() helper ran the formatted message as a command: "[Codegen] $1" >> "${SCRIPT_OUTPUT_FILE_0}" so the intended log line was instead treated as the name of a program to execute. With set -e and set -o pipefail active, the resulting "command not found" aborted the script with status 127 before the intended exit 1, and SCRIPT_OUTPUT_FILE_0 captured the shell error rather than the message. Because the function only referenced $1, the multi-argument call in find_node also silently dropped the second and third parts of its message. Join the arguments with "$*" and echo the message, restoring full multi-part logging and a clean exit 1. --- .../scripts/react_native_pods_utils/script_phases.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/react_native_pods_utils/script_phases.sh b/packages/react-native/scripts/react_native_pods_utils/script_phases.sh index 4606f35fbe69..05d7211dc863 100755 --- a/packages/react-native/scripts/react_native_pods_utils/script_phases.sh +++ b/packages/react-native/scripts/react_native_pods_utils/script_phases.sh @@ -16,8 +16,9 @@ cd "$RCT_SCRIPT_RN_DIR" CODEGEN_CLI_PATH="" error () { - echo "$1" - "[Codegen] $1" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1 + message="$*" + echo "$message" + echo "[Codegen] $message" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1 exit 1 }