From a4ec49cbe6d0157417276731ba1608e482f3f10e Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Wed, 21 Aug 2024 08:16:37 -0700 Subject: [PATCH] fix(react-native-xcode): Use `CONFIG_CMD` if set (#46112) Summary: In the recent 0.75 release I've noticed new `CONFIG_CMD` option in `react-native-xcode.sh`. But this option was not used. Insted when set `CONFIG_APP` was used. This seems like a bug. As the usage before this PR would be as follow: ```bash export CONFIG_CMD=true export CONFIG_APP="/path/to/node /path/to/node_modules/react-native/cli.js config" ``` After this PR ``` export CONFIG_CMD="/path/to/node /path/to/node_modules/react-native/cli.js config" ``` This PR also removed unused explicite `--config-cmd "$CONFIG"` flag, as this is always overwriten by the code above, by default to `--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config`. ## Changelog: [iOS][Fixed] - Use CONFIG_CMD if set Pull Request resolved: https://github.com/facebook/react-native/pull/46112 Test Plan: I've set `CONFIG_CMD` and run Xcode Release build to check that the set command is executed. Reviewed By: christophpurrer Differential Revision: D61545010 Pulled By: blakef fbshipit-source-id: ebbf8ebc08404bc6816277518a3b86c6f7e41e6e --- packages/react-native/scripts/react-native-xcode.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/scripts/react-native-xcode.sh b/packages/react-native/scripts/react-native-xcode.sh index 345603cc7dca91..2f37a65b17bcff 100755 --- a/packages/react-native/scripts/react-native-xcode.sh +++ b/packages/react-native/scripts/react-native-xcode.sh @@ -141,7 +141,7 @@ fi if [[ -n "$CONFIG_JSON" ]]; then EXTRA_ARGS+=("--load-config" "$CONFIG_JSON") elif [[ -n "$CONFIG_CMD" ]]; then - EXTRA_ARGS+=("--config-cmd" "$CONFIG_APP") + EXTRA_ARGS+=("--config-cmd" "$CONFIG_CMD") else EXTRA_ARGS+=("--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config") fi @@ -149,7 +149,6 @@ fi # shellcheck disable=SC2086 "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \ $CONFIG_ARG \ - --config-cmd "$CONFIG" \ --entry-file "$ENTRY_FILE" \ --platform "$BUNDLE_PLATFORM" \ --dev $DEV \