-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update update_version script to no longer need unused params
- Loading branch information
crow
committed
Dec 9, 2024
1 parent
8ee960f
commit acb0976
Showing
1 changed file
with
9 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
#!/bin/bash -ex | ||
|
||
REPO_PATH=`dirname "${0}"`/.. | ||
REPO_PATH=$(dirname "${0}")/.. | ||
|
||
print_usage() { | ||
echo "usage: $0 -p <package_version>" | ||
echo "usage: $0 <package_version>" | ||
} | ||
|
||
while getopts p:i:a: FLAG | ||
do | ||
case "${FLAG}" in | ||
p) VERSION=${OPTARG} ;; | ||
*) print_usage | ||
exit 1 ;; | ||
esac | ||
done | ||
|
||
if [ -z $VERSION ] | ||
then | ||
if [ $# -lt 1 ]; then | ||
echo "$0: A package version is required" | ||
print_usage | ||
exit 1 | ||
fi | ||
|
||
VERSION=$1 | ||
|
||
echo "Updating package version to $VERSION in package.json..." | ||
sed -i '' "s/\"version\": \".*\",/\"version\": \"$VERSION\",/g" "$REPO_PATH/package.json" | ||
|
||
sed -i '' "s/\version\": \".*\",/\version\": \"$VERSION\",/g" "$REPO_PATH/package.json" | ||
echo "Updating version to $VERSION in ios/AirshipReactNative.swift..." | ||
sed -i '' "s/\(version:\ String *= *\)\".*\"/\1\"$VERSION\"/g" "$REPO_PATH/ios/AirshipReactNative.swift" | ||
|
||
# Update iOS example dependencies | ||
# sed -i '' "s/\(pod *'AirshipExtensions\/NotificationService', *'~> *\).*'/\1$IOS_VERSION'/g" example/ios/Podfile | ||
echo "Version update complete." |