Skip to content

Commit 6afacda

Browse files
committed
Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (facebook#28354)"
This reverts commit a8e8502.
1 parent 52c8c2f commit 6afacda

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

scripts/react-native-xcode.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,11 @@ case "$CONFIGURATION" in
5656
;;
5757
esac
5858

59-
# Setting up a project root was a workaround to enable support for non-standard
60-
# structures, including monorepos. Today, CLI supports that out of the box
61-
# and setting custom `PROJECT_ROOT` only makes it confusing.
62-
#
63-
# As a backwards-compatible change, I am leaving "PROJECT_ROOT" support for those
64-
# who already use it - it is likely a non-breaking removal.
65-
#
66-
# For new users, we default to $PWD - not changing things all.
67-
#
68-
# For context: https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead#commitcomment-37914902
69-
PROJECT_ROOT=${PROJECT_ROOT:-$PWD}
59+
# Path to react-native folder inside node_modules
60+
REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
61+
# The project should be located next to where react-native is installed
62+
# in node_modules.
63+
PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."}
7064

7165
cd "$PROJECT_ROOT" || exit
7266

@@ -109,9 +103,6 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then
109103
fi
110104
fi
111105

112-
# Path to react-native folder inside node_modules
113-
REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
114-
115106
# check and assign NODE_BINARY env
116107
# shellcheck source=/dev/null
117108
source "$REACT_NATIVE_DIR/scripts/node-binary.sh"

0 commit comments

Comments
 (0)