diff --git a/package-lock.json b/package-lock.json index 7679137..6d4f1de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,8 @@ "eslint-config-gbv": "~2.2", "lint-staged": "^15.2.10", "nodemon": "^3.1.7", - "pre-commit": "^1.2.2" + "pre-commit": "^1.2.2", + "yesno": "^0.4.0" }, "engines": { "node": ">=18" @@ -8466,6 +8467,13 @@ "node": ">=8" } }, + "node_modules/yesno": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/yesno/-/yesno-0.4.0.tgz", + "integrity": "sha512-tdBxmHvbXPBKYIg81bMCB7bVeDmHkRzk5rVJyYYXurwKkHq/MCd8rz4HSJUP7hW0H2NlXiq8IFiWvYKEHhlotA==", + "dev": true, + "license": "BSD" + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index f01f8a2..a68e972 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "build": "vite build", "express:serve": "NODE_ENV=development nodemon server.js", "dev": "concurrently -k \"npm:express:serve\" \"npm:vue:serve\"", - "release": "git checkout dev && git pull && npm version $SEMVER && git push && git checkout main && git merge dev && git push --follow-tags && git checkout dev", + "yesno": "node -e \"const yesno = require('yesno'); yesno({ question: 'Are you sure you want to continue?' }).then(ok => process.exit(ok ? 0 : 1));\"", + "release": "test $(git rev-parse --abbrev-ref HEAD) = dev && git pull && npm version $SEMVER && npm run --silent yesno && (git push && git checkout main && git merge dev && git push --follow-tags && git checkout dev) || (git tag -d $(git describe --tags) && git reset --hard HEAD~1)", "release:patch": "SEMVER=patch npm run release", "release:minor": "SEMVER=minor npm run release", "release:major": "SEMVER=major npm run release" @@ -74,7 +75,8 @@ "eslint-config-gbv": "~2.2", "lint-staged": "^15.2.10", "nodemon": "^3.1.7", - "pre-commit": "^1.2.2" + "pre-commit": "^1.2.2", + "yesno": "^0.4.0" }, "nodemonConfig": { "ignore": [