Skip to content

Commit

Permalink
Merge pull request #13 from aguegu/master
Browse files Browse the repository at this point in the history
version parse with cut
  • Loading branch information
markchalloner committed Apr 21, 2016
2 parents 618b089 + 4802430 commit dea5b5c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions git-semver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,23 +326,16 @@ plugin-debug() {
# Version functions
########################################

version-parse() {
echo $1 | sed 's#^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)$#\1 \2 \3#g'
}

version-parse-major() {
local version=($(version-parse $1))
echo ${version[0]}
echo $1 | cut -d "." -f1
}

version-parse-minor() {
local version=($(version-parse $1))
echo ${version[1]}
echo $1 | cut -d "." -f2
}

version-parse-patch() {
local version=($(version-parse $1))
echo ${version[2]}
echo $1 | cut -d "." -f3
}

version-get() {
Expand Down

0 comments on commit dea5b5c

Please sign in to comment.