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# This script updates RNTester Podfile.lock after verifying the CocoaPods environment.
8# Usage:
9#   source scripts/update_podfile_lock && update_pods
10
11THIS_DIR=$(cd -P "$(dirname "$(realpath "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
12RNTESTER_DIR="$THIS_DIR/../packages/rn-tester"
13
14# Keep this separate for FB internal access.
15validate_env () {
16  cd "$RNTESTER_DIR" || exit
17  bundle check || exit
18  cd "$THIS_DIR" || exit
19}
20
21update_pods () {
22  cd "$RNTESTER_DIR" || exit
23  bundle check || exit
24  bundle exec pod install
25  cd "$THIS_DIR" || exit
26}
27