From 7c05906c459e576eac751f759b2389556c856897 Mon Sep 17 00:00:00 2001 From: Bjorn Voesten Date: Mon, 2 Nov 2020 22:04:56 +0100 Subject: [PATCH] Updated tag script --- .gitignore | 1 - tag.sh | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d21b06d..663d5ae 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,3 @@ npm-debug.log yarn-error.log .idea/ .vagrant/ -.version diff --git a/tag.sh b/tag.sh index 30d1fff..f2e269d 100755 --- a/tag.sh +++ b/tag.sh @@ -1,17 +1,16 @@ -RED='\033[0;31m' -GREEN='\033[0;32m' +#!/bin/bash -# Get the version -NEW_VERSION=$(cat .version) +# Prompt the version +read -p "Version: " version # Check if the version already exists -if [ $(git tag -l "$NEW_VERSION") ]; then - echo "${RED}Version already exists!" +if [ $(git tag -l "$version") ]; then + echo "Version already exists!" exit fi # Create and push the tag -git tag $NEW_VERSION +git tag $version git push --tags -echo "${GREEN}Done." +echo "Done."