-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSS: update Podfile.lock automatically when bumping release version
Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90
- Loading branch information
1 parent
1a1c3a6
commit d3c7e20
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/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. | ||
|
||
# This script updates RNTester Podfile.lock after verifying the CocoaPods environment. | ||
# Usage: | ||
# source scripts/update_podfile_lock && update_pods | ||
|
||
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) | ||
RNTESTER_DIR="$THIS_DIR/../packages/rn-tester" | ||
|
||
# Note: Keep in sync with FB internal. | ||
REQUIRED_COCOAPODS_VERSION="1.10.1" | ||
|
||
validate_env () { | ||
# Check that CocoaPods is working. | ||
if [ -z "$(command -v pod)" ]; then | ||
echo "You need to install CocoaPods." | ||
echo "See https://guides.cocoapods.org/using/getting-started.html#getting-started for instructions." | ||
exit 1 | ||
fi | ||
|
||
COCOAPODS_VERSION=$(pod --version) | ||
if [[ "$COCOAPODS_VERSION" != "$REQUIRED_COCOAPODS_VERSION" ]]; | ||
then | ||
echo "You must have CocoaPods $REQUIRED_COCOAPODS_VERSION installed; you have $COCOAPODS_VERSION." | ||
echo "Installing via gem is recommended:" | ||
echo " sudo gem install cocoapods -v $REQUIRED_COCOAPODS_VERSION" | ||
exit 1 | ||
fi | ||
} | ||
|
||
update_pods () { | ||
validate_env | ||
|
||
cd "$RNTESTER_DIR" || exit | ||
pod install | ||
cd "$THIS_DIR" || exit | ||
} |