From ddeea2b9337e79358d912f6f7fa0ca6d24721dbc Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 4 Oct 2018 06:42:59 -0400 Subject: [PATCH] include commit id in release commit and tag message --- npm2git.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/npm2git.sh b/npm2git.sh index a2b5d69..89bb7a1 100755 --- a/npm2git.sh +++ b/npm2git.sh @@ -4,6 +4,9 @@ set -e # go to root of repository cd $(git rev-parse --show-toplevel) +# get commit id +COMMIT_ID="$(git rev-parse HEAD)" + # extract package name and version from package.json, remove devDependencies and scripts.prepare ORIG_PKG="$(cat package.json)" read NAME VERSION < <(node -e ' @@ -29,8 +32,8 @@ git add -f $(tar tf ${NAME}-${VERSION}.tgz | cut -c 9-) rm ${NAME}-${VERSION}.tgz # commit and tag -git commit -m "Release v${VERSION}" -git tag v${VERSION} -a -m "v${VERSION}" +git commit -m "v${VERSION} @ ${COMMIT_ID}" +git tag v${VERSION} -a -m "v${VERSION} @ ${COMMIT_ID}" # return to original state git reset ${ORIG_BRANCH}