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