mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
b399c2e3d1
Summary: Custom metro port not working without exporting variables from `.packager.env` ## Changelog [General] [Fixed] - Fix support for custom port Pull Request resolved: https://github.com/facebook/react-native/pull/32666 Test Plan: run `react-native run-android --port=8082` and `react-native run-ios --port=8082` Reviewed By: yungsters Differential Revision: D32694233 Pulled By: cortinico fbshipit-source-id: 42e803d56b83608024b901d2a3024733ed7099b7
31 lines
909 B
Bash
Executable File
31 lines
909 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
# Set terminal title
|
|
echo -en "\\033]0;Metro\\a"
|
|
clear
|
|
|
|
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
|
|
|
# export packager environment variables
|
|
source "$THIS_DIR/.packager.env"
|
|
|
|
if [ -n "${RCT_PACKAGER_LOGS_DIR}" ] ; then
|
|
echo "Writing logs to $RCT_PACKAGER_LOGS_DIR"
|
|
# shellcheck source=/dev/null
|
|
RCT_PACKAGER_LOG_PATH="$RCT_PACKAGER_LOGS_DIR/metro.log" \
|
|
. "$THIS_DIR/packager.sh" \
|
|
> "$RCT_PACKAGER_LOGS_DIR/packager.stdout.log" \
|
|
2> "$RCT_PACKAGER_LOGS_DIR/packager.stderr.log"
|
|
else
|
|
# shellcheck source=/dev/null
|
|
. "$THIS_DIR/packager.sh"
|
|
fi
|
|
if [[ -z "$CI" ]]; then
|
|
echo "Process terminated. Press <enter> to close the window"
|
|
read -r
|
|
fi
|