1#!/bin/bash 2# Copyright (c) Meta Platforms, Inc. and affiliates. 3# 4# This source code is licensed under the MIT license found in the 5# LICENSE file in the root directory of this source tree. 6 7# scripts directory 8THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) 9REACT_NATIVE_ROOT="$THIS_DIR/.." 10# Application root directory - General use case: react-native is a dependency 11PROJECT_ROOT="$THIS_DIR/../../.." 12 13# check and assign NODE_BINARY env 14# shellcheck disable=SC1090 15source "${THIS_DIR}/node-binary.sh" 16 17# When running react-native tests, react-native doesn't live in node_modules but in the PROJECT_ROOT 18if [ ! -d "$PROJECT_ROOT/node_modules/react-native" ]; 19then 20 PROJECT_ROOT="$THIS_DIR/.." 21fi 22# Start packager from PROJECT_ROOT 23cd "$PROJECT_ROOT" || exit 24"$NODE_BINARY" "$REACT_NATIVE_ROOT/cli.js" start --custom-log-reporter-path "$THIS_DIR/packager-reporter.js" "$@" 25