Skip to content

Commit

Permalink
Add script to update Xcode and Pod version
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephDuffy committed Jul 8, 2019
1 parent d8b42a0 commit 61aff35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .rocket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
before:
- script:
content: ./scripts/update-version.sh "$VERSION"
14 changes: 14 additions & 0 deletions scripts/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "A single argument specifying the version must be provided"
exit 1
fi

VERSION=$1
NORMALISED_VERSION=${VERSION#"v"}

echo "Setting version in Xcode project to $NORMALISED_VERSION"
sed -E -i "" "s/(VERSION_NUMBER[[:blank:]]*=[[:blank:]]*).*;/\1$NORMALISED_VERSION;/" ./Partial.xcodeproj/project.pbxproj
echo "Setting version in Podspec to $NORMALISED_VERSION"
sed -E -i "" "s/(spec\\.version[[:blank:]]*=[[:blank:]]*)\".*\"/\1\"$NORMALISED_VERSION\"/" ./Partial.podspec

0 comments on commit 61aff35

Please sign in to comment.