Skip to content

Instantly share code, notes, and snippets.

@speaud
Created February 1, 2024 18:38
Show Gist options
  • Save speaud/e91cfffa72cb4dd72a2c4a89a9590aba to your computer and use it in GitHub Desktop.
Save speaud/e91cfffa72cb4dd72a2c4a89a9590aba to your computer and use it in GitHub Desktop.
NPM scripts to help with version tagging
"tag:create": "echo \"enter version to create: \" && read x && git tag $x $(git log -n 1 --pretty=format:\"%h\") && git push origin $x && sed -i -e \"s/\\\"version\\\": \\\"[0-9]*.[0-9]*.[0-9]*\\\"/\\\"version\\\": \\\"$x\\\"/g\" package.json && git add . && git commit -m \"Bump version\" && git push",
"tag:delete": "echo \"enter version to delete: \" && read y && git tag -d $y && git push --delete origin $y"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment