bug: when used programatically it doesn't analyzes commits and no version bump
See original GitHub issuewhen used via node and executed via npm scripts, it doesn’t analyses commits and makes no version bump -> erorr is trown:
Error:
$ yarn release
yarn release v0.21.3
$ node scripts/release.js
✖ skip version bump on first release
✔ outputting changes to CHANGELOG.md
✔ committing CHANGELOG.md
Command failed: git commit CHANGELOG.md -m "chore(release): 1.1.1"
{ Error: Command failed: git commit CHANGELOG.md -m "chore(release): 1.1.1"
at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
killed: false,
code: 1,
signal: null,
cmd: 'git commit CHANGELOG.md -m "chore(release): 1.1.1"' }
my setup:
git history since last release:
7844389 fix: some temp change in scripts
d3fcb98 chore(release): 1.1.1
457e508 build: handle tag and ammend creation properly
this 7844389 fix: some temp change in scripts
-> should bump version to 1.1.2
scripts/release.js
const standardVersion = require('standard-version');
const {isInitialRelease} = require('./lib/utils');
const standardVersionConfig = isInitialRelease() ? {firstRelease: true} : {}
// Options are the same as command line, except camelCase
standardVersion(standardVersionConfig, function(err) {
if (err) {
console.log(err)
}
// standard-version is done
})
package.json
{
"scripts": {
"release": "node scripts/release.js"
}
}
although everything works when i use it directly from npm scripts:
package.json
{
"scripts": {
"release": "standard-version"
}
}
result:
$ yarn release
yarn release v0.21.3
$ standard-version
✔ bumping version in package.json from 1.1.1 to 1.1.2
✔ outputting changes to CHANGELOG.md
✔ committing package.json and CHANGELOG.md
> husky - npm run -s commitmsg
✔ tagging release 1.1.2
ℹ Run `git push --follow-tags origin master` to publish
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
conventional-commits bumps 0.x versions incorrectly #1699
Describe the bug When the version is 0.1.0 and a feat: commit is merged, the version is bumped to 0.2.0 instead of 0.1.1....
Read more >How do I programmatically determine if there are uncommitted ...
One problem I bumped in is that git diff-index will tell that there are differences when indeed there is none except for timestamps...
Read more >001: High level problem analysis - MkDocs Newsletter
I found myself skipping these batch processing tasks in the past, as my brain sees them as dreadful, long and heavy. Use semantic...
Read more >Full Text Bug Listing - Bugs - Eclipse.org
The warning shows up if executing the transformation as is (i.e. inside the workspace where it is compiled) would produce a "No blackbox...
Read more >Using Prettier and ESLint to automate formatting and fixing ...
Linting is a type of static analysis that finds problematic patterns and code that doesn't adhere to certain style guidelines. Since JavaScript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey! sure I will double check. Unfortunately this is in company private repo, so you’ll have to wait 'till tomorrow… sorry.
anyway thx for help and super quick responses ! you da man yo! 🍺
Well, so it appears I’m an idiot ! 😄 well this is what happens if you work overtime late night. Of course
isInitialRelease()
was returning opposite… all good now. So either we can close this or keep it open for that error message investigation.Cheers!