Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
c-geek committed Mar 25, 2016
1 parent 7f222a4 commit 285a9ae
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

current=`grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -oP "\d+.\d+.\d+(\w*)"`
echo "Current version: $current"

if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; then
# Change the version in package.json and test file
sed -i "s/version\": \"$current/version\": \"$1/g" package.json

# Commit
git reset HEAD
git add package.json
git commit -m "v$1"
git tag "v$1"
else
echo "Wrong version format"
fi

0 comments on commit 285a9ae

Please sign in to comment.