Skip to content

Commit d578d18

Browse files
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.
1 parent b32a6c9 commit d578d18

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/react-native/scripts/react_native_pods_utils/script_phases.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ cd "$RCT_SCRIPT_RN_DIR"
1616
CODEGEN_CLI_PATH=""
1717

1818
error () {
19-
echo "$1"
20-
"[Codegen] $1" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1
19+
message="$*"
20+
echo "$message"
21+
echo "[Codegen] $message" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1
2122
exit 1
2223
}
2324

0 commit comments

Comments
 (0)