Skip to content

Commit

Permalink
fixed sh error again :(
Browse files Browse the repository at this point in the history
  • Loading branch information
oe committed Mar 18, 2018
1 parent 443b937 commit c566a54
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions post-publish2npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ grey='\033[0;37m'
# no color
NC='\033[0m'

# trim string
trim() {
local var="$*"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
echo -n "$var"
}

# tag
# read package.json's version
version=`cat package.json | awk -F [:] '/version/{print $2}' | sed 's/[\"\,]//g'`
tag="${version}"
tag="v`trim ${version}`"

git tag ${tag}
git push origin ${tag}
git tag "${tag}"
git push origin "${tag}"

echo -e "\n${green}New Tag ${tag} has been push to origin:)"

0 comments on commit c566a54

Please sign in to comment.