Skip to content

Commit

Permalink
improved postversion hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed Aug 9, 2021
1 parent 8572e95 commit 93b6e1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"prebuild": "npm run test && npm run lint && npm run clean",
"build": "tsc --outDir dist && npm run executable",
"executable": "sed -i \"1s/^/#!\\/usr\\/bin\\/env node\\n/\" dist/index.js",
"version:patch": "npm run build && npm version patch",
"version:minor": "npm run build && npm version minor",
"version:major": "npm run build && npm version major",
"postversion": "generate-readme && git add . && git commit --amend --no-edit"
"postversion": "bash ./scripts/postversion.sh"
},
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions scripts/postversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

declare version=$(printenv | grep -e "npm_package_version" | tail -c 6)

generate-readme &&
git commit --all --no-edit --amend &&
git tag -af $(git tag --list | tail -n 1) -m "bumped version to $version"

0 comments on commit 93b6e1c

Please # to comment.