Skip to content

Commit

Permalink
Updated cog tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpaulphan committed Mar 23, 2017
1 parent f29435b commit 8a4dfb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/cog-tag
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ ask() {
createTag() {
NEW_VERSION="v$1.$2.$3"
echo -e "Updated version $VERSION ➡️ ${YELLOW}$NEW_VERSION${NC}"
git tag -a $NEW_VERSION -m "Tag $NEW_VERSION"
git tag -a $NEW_VERSION -m "$NEW_VERSION"
}

# Fetch tags
git fetch --tags

# Get latest version
VERSION=$(git describe)
VERSION=$(git describe --abbrev=0 --tags)

# Check if current project has tags
if [[ -z "$VERSION" ]]; then
Expand Down Expand Up @@ -71,13 +71,14 @@ if [ -z "$1" ];
echo -e "Run ${GREEN}cog tag [ major | minor | patch | push ]${NC}"
elif [[ $1 == 'major' ]]; then
MAJOR_VALUE=$((MAJOR_VALUE+1))
MINOR_VALUE=0
PATCH_VALUE=0
createTag $MAJOR_VALUE $MINOR_VALUE $PATCH_VALUE
elif [[ $1 == 'minor' ]]; then
# If v1.9.0
if [[ $MINOR_VALUE == 9 ]]; then
MAJOR_VALUE=$((MAJOR_VALUE+1))
MINOR_VALUE=0
MINOR_VALUE=0
# If v2.0.0
createTag $MAJOR_VALUE $MINOR_VALUE $PATCH_VALUE
else
Expand Down

0 comments on commit 8a4dfb6

Please sign in to comment.