Skip to content

Commit acb0976

Browse files
author
crow
committed
Update update_version script to no longer need unused params
1 parent 8ee960f commit acb0976

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

scripts/update_version.sh

+9-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
1-
#!/bin/bash -ex
2-
3-
REPO_PATH=`dirname "${0}"`/..
1+
REPO_PATH=$(dirname "${0}")/..
42

53
print_usage() {
6-
echo "usage: $0 -p <package_version>"
4+
echo "usage: $0 <package_version>"
75
}
86

9-
while getopts p:i:a: FLAG
10-
do
11-
case "${FLAG}" in
12-
p) VERSION=${OPTARG} ;;
13-
*) print_usage
14-
exit 1 ;;
15-
esac
16-
done
17-
18-
if [ -z $VERSION ]
19-
then
7+
if [ $# -lt 1 ]; then
208
echo "$0: A package version is required"
219
print_usage
2210
exit 1
2311
fi
2412

13+
VERSION=$1
14+
15+
echo "Updating package version to $VERSION in package.json..."
16+
sed -i '' "s/\"version\": \".*\",/\"version\": \"$VERSION\",/g" "$REPO_PATH/package.json"
2517

26-
sed -i '' "s/\version\": \".*\",/\version\": \"$VERSION\",/g" "$REPO_PATH/package.json"
18+
echo "Updating version to $VERSION in ios/AirshipReactNative.swift..."
2719
sed -i '' "s/\(version:\ String *= *\)\".*\"/\1\"$VERSION\"/g" "$REPO_PATH/ios/AirshipReactNative.swift"
2820

29-
# Update iOS example dependencies
30-
# sed -i '' "s/\(pod *'AirshipExtensions\/NotificationService', *'~> *\).*'/\1$IOS_VERSION'/g" example/ios/Podfile
21+
echo "Version update complete."

0 commit comments

Comments
 (0)