Skip to content

Commit 542c506

Browse files
hramosamgleitman
authored andcommitted
Fix path to react-native-codegen
Summary: The wrong value for the path to react-native-codegen was being used. The issue was introduced during the refactoring of this script for use in FBReactNativeSpec.podspec. Changelog: [Internal] Motivation: Reviewed By: fkgozali Differential Revision: D25290355 fbshipit-source-id: 5a46c680e7ea41157b03cf54a640a8816fb682b3
1 parent 735bd91 commit 542c506

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

scripts/generate-native-modules-specs.sh

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ set -e
2525
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
2626
TEMP_DIR=$(mktemp -d /tmp/react-native-codegen-XXXXXXXX)
2727
RN_DIR=$(cd "$THIS_DIR/.." && pwd)
28-
CODEGEN_PATH="${CODEGEN_PATH:-$(cd "$RN_DIR/packages" && pwd)}"
29-
CODEGEN_DIR="$CODEGEN_PATH/react-native-codegen"
30-
28+
CODEGEN_PATH="${CODEGEN_PATH:-$(cd "$RN_DIR/packages/react-native-codegen" && pwd)}"
3129
YARN_BINARY="${YARN_BINARY:-$(command -v yarn)}"
3230

3331
cleanup () {
@@ -40,33 +38,23 @@ describe () {
4038
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1"
4139
}
4240

43-
step_build_codegen () {
44-
if [ ! -d "$CODEGEN_DIR/lib" ]; then
45-
describe "Building react-native-codegen package"
46-
pushd "$CODEGEN_DIR" >/dev/null || exit
47-
"$YARN_BINARY"
48-
"$YARN_BINARY" build
49-
popd >/dev/null || exit
50-
fi
51-
}
52-
5341
run_codegen () {
5442
SRCS_DIR=$1
5543
LIBRARY_NAME=$2
5644
OUTPUT_DIR=$3
5745

5846
SCHEMA_FILE="$TEMP_DIR/schema-$LIBRARY_NAME.json"
5947

60-
if [ ! -d "$CODEGEN_DIR/lib" ]; then
48+
if [ ! -d "$CODEGEN_PATH/lib" ]; then
6149
describe "Building react-native-codegen package"
62-
pushd "$CODEGEN_DIR" >/dev/null || exit
50+
pushd "$CODEGEN_PATH" >/dev/null || exit
6351
"$YARN_BINARY"
6452
"$YARN_BINARY" build
6553
popd >/dev/null || exit
6654
fi
6755

6856
describe "Generating schema from flow types"
69-
"$YARN_BINARY" node "$CODEGEN_DIR/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
57+
"$YARN_BINARY" node "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
7058

7159
describe "Generating native code from schema (iOS)"
7260
pushd "$RN_DIR" >/dev/null || exit

0 commit comments

Comments
 (0)