1*fe5cfb17STomasz Sapeta#!/bin/bash
2*fe5cfb17STomasz Sapeta# Copyright (c) Meta Platforms, Inc. and affiliates.
3*fe5cfb17STomasz Sapeta#
4*fe5cfb17STomasz Sapeta# This source code is licensed under the MIT license found in the
5*fe5cfb17STomasz Sapeta# LICENSE file in the root directory of this source tree.
6*fe5cfb17STomasz Sapeta
7*fe5cfb17STomasz Sapeta# Set terminal title
8*fe5cfb17STomasz Sapetaecho -en "\\033]0;Metro\\a"
9*fe5cfb17STomasz Sapetaclear
10*fe5cfb17STomasz Sapeta
11*fe5cfb17STomasz SapetaTHIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
12*fe5cfb17STomasz Sapeta
13*fe5cfb17STomasz Sapetaexport PODS_ROOT="$THIS_DIR/../../../ios/Pods"
14*fe5cfb17STomasz SapetaWITH_ENVIRONMENT="$THIS_DIR/xcode/with-environment.sh"
15*fe5cfb17STomasz Sapetasource $WITH_ENVIRONMENT
16*fe5cfb17STomasz Sapeta
17*fe5cfb17STomasz Sapeta# export packager environment variables
18*fe5cfb17STomasz Sapetasource "$THIS_DIR/.packager.env"
19*fe5cfb17STomasz Sapeta
20*fe5cfb17STomasz Sapetaif [ -n "${RCT_PACKAGER_LOGS_DIR}" ] ; then
21*fe5cfb17STomasz Sapeta  echo "Writing logs to $RCT_PACKAGER_LOGS_DIR"
22*fe5cfb17STomasz Sapeta  # shellcheck source=/dev/null
23*fe5cfb17STomasz Sapeta  RCT_PACKAGER_LOG_PATH="$RCT_PACKAGER_LOGS_DIR/metro.log" \
24*fe5cfb17STomasz Sapeta  . "$THIS_DIR/packager.sh" \
25*fe5cfb17STomasz Sapeta    > "$RCT_PACKAGER_LOGS_DIR/packager.stdout.log" \
26*fe5cfb17STomasz Sapeta    2> "$RCT_PACKAGER_LOGS_DIR/packager.stderr.log"
27*fe5cfb17STomasz Sapetaelse
28*fe5cfb17STomasz Sapeta  # shellcheck source=/dev/null
29*fe5cfb17STomasz Sapeta  . "$THIS_DIR/packager.sh"
30*fe5cfb17STomasz Sapetafi
31*fe5cfb17STomasz Sapetaif [[ -z "$CI" ]]; then
32*fe5cfb17STomasz Sapeta  echo "Process terminated. Press <enter> to close the window"
33*fe5cfb17STomasz Sapeta  read -r
34*fe5cfb17STomasz Sapetafi
35