Skip to content

Commit

Permalink
Make sure script doesn't bail out if yarn is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis authored Jan 26, 2021
1 parent e1ab913 commit bcdb986
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/generate-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set -e
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
TEMP_DIR=$(mktemp -d /tmp/react-native-codegen-XXXXXXXX)
RN_DIR=$(cd "$THIS_DIR/.." && pwd)
YARN_BINARY="${YARN_BINARY:-$(command -v yarn)}"
YARN_BINARY="${YARN_BINARY:-$(command -v yarn || true)}"
USE_FABRIC="${USE_FABRIC:-0}"

cleanup () {
Expand Down Expand Up @@ -55,6 +55,11 @@ main() {

CODEGEN_REPO_PATH="$RN_DIR/packages/react-native-codegen"
CODEGEN_NPM_PATH="$RN_DIR/../react-native-codegen"

if [ -z "$YARN_BINARY" ]; then
echo "Error: Could not find yarn. Make sure it is in bash PATH or set the YARN_BINARY environment variable." 1>&2
exit 1
fi

if [ -d "$CODEGEN_REPO_PATH" ]; then
CODEGEN_PATH=$(cd "$CODEGEN_REPO_PATH" && pwd)
Expand Down

0 comments on commit bcdb986

Please sign in to comment.