Skip to content

Commit

Permalink
Update update_version script to no longer need unused params
Browse files Browse the repository at this point in the history
  • Loading branch information
crow committed Dec 9, 2024
1 parent 8ee960f commit acb0976
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions scripts/update_version.sh
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."

0 comments on commit acb0976

Please sign in to comment.