Comments (8)
That would be hard for me to look into, since I don't have that set up. Any help would be appreciated.
However, the source code of release-it doesn't contain any calls to substring
. Are you sure you don't have any errors during execution of e.g. a buildCommand
?
from release-it.
It seems it's the shell.js/exec failing to execute some windows command you pass it.
Here is the relevant log:
$ release-it --debug
{ _: [],
debug: true,
e: true,
npm:
{ version: '0.1.48',
name: '@mynamespace/ns-module-notification',
private: false,
publish: false,
publishPath: '.',
tag: 'latest',
forcePublishSourceRepo: false },
'non-interactive': false,
'dry-run': false,
verbose: false,
force: false,
pkgFiles: [ 'package.json' ],
increment: 'patch',
prereleaseId: null,
commitMessage: 'Release %s',
tagName: '%s',
tagAnnotation: 'Release %s',
buildCommand: false,
changelogCommand: 'git log --pretty=format:\'* %s (%h)\' [REV_RANGE]',
requireCleanWorkingDir: false,
src:
{ pushRepo: null,
beforeStartCommand: false,
beforeStageCommand: false,
afterReleaseCommand: false },
dist:
{ repo: false,
stageDir: '.stage',
baseDir: 'dist',
files: [ '**/*' ],
pkgFiles: null,
beforeStageCommand: false,
afterReleaseCommand: false },
github:
{ release: false,
releaseName: 'Release %s',
tokenRef: 'GITHUB_TOKEN' },
name: '@namespace/ns-module-notification' }
Release source repo
____ { [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "git diff-index --name-only HEAD --exit-code"
]
killed: false,
code: 1,
signal: null,
cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "git diff-index --name-only HEAD --exit-code"' }
ERROR Cannot read property 'substring' of undefined
[promises] Unhandled rejections: 1
Error: TypeError: Cannot read property 'substring' of undefined
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\bin\release.js:16:15
from execution context:
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\lib\enquiry.js:90:25
from execution context:
at Array.reduce (native)
from execution context:
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\node_modules\when\sequence.js:32:16
from execution context:
at sequence (C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\node_modules\when\sequence.js:31:10)
at module.exports (C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\lib\enquiry.js:98:12)
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\node_modules\when\sequence.js:33:22
from execution context:
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\lib\shell.js:42:21
at C:\Users\larcher\AppData\Roaming\npm\node_modules\release-it\node_modules\shelljs\src\exec.js:143:7
at ChildProcess.exithandler (child_process.js:758:5)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
You can see a custom log I added in there, coming from that line in exec.js:140
var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) {
if (callback)
if( err) console.log('____',err)
callback(err ? err.code : 0, output);
});
from release-it.
Apologies for being unresponsive so far. So shell.js
is executing the following command:
C:\Windows\system32\cmd.exe /s /c "git diff-index --name-only HEAD --exit-code"
What happens if you run either that whole command manually, and what happens if you run git diff-index --name-only HEAD --exit-code
, from the Git repo?
Some relevant links:
from release-it.
When using the first command, I end up in a windows CLI, as if the params were not taken into account:
[00:06] Somatt@Ninja:Ihm (master + u=) $C:\\Windows\\system32\\cmd.exe /s /c "git diff-index --name-only HEAD --exit-code"
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits r▒serv▒s.
D:\UwAmp\www\f6\traceone\Ihm>
I have to use exit
to get back to the git-bash shell.
When using the second command, I get package.json
output.
For what it's worth, release-it doesn't have this problem on older version of git-bash (1.9.6 I think)
from release-it.
Closing, since I'm pretty sure there's not much we can do in this project. Feel free to discuss, though.
from release-it.
This looks like an escaping issue that could be fixed on either sides. If you're not willing to investigate any further, I won't insist. I just won't use your library even though it looks promising, as most of my team uses git-bash as their goto shell.
from release-it.
I don't think it's an escaping issue, please see SBoudrias/Inquirer.js#272 (comment) for an explanation and links to more related details.
from release-it.
Thanks for the link. I better understand the core issue now.
One thing puzzles me, though : if the issue is about gitBash not being a true TTY, how come release-it was not crashing in a previous version of it ?
Anyhow, thanks for your time and keep up the good work.
from release-it.
Related Issues (20)
- Discussion - Pre-releases changelog duplicating header for pre-releases header HOT 3
- NPM IP package vulnerable to Server-Side Request Forgery (SSRF) attacks HOT 3
- Release-it picks up wrong release number. HOT 8
- Bug - Issue with github comment on resolved items HOT 10
- [ERROR] GitLab CI error on NPM notice HOT 2
- Cannot understand how release verison is calculated HOT 2
- Hook for after changelog is written to CHANGELOG.md? HOT 2
- Bug: Error when rolling back git tag release suppresses original error
- Error Invalid version HOT 7
- beta and alpha releases do not work HOT 6
- When publishing an npm package, when the publishPath option is set, isCollaborator should detect package.json under publishPath instead of the current directory. HOT 2
- Wrong documentation related to running a custom Git Push command HOT 3
- How can I change method of releasing (from "Release 0.0.1" to "v0.0.1") ? HOT 3
- How can I change parametrs from "Release 0.0.0" to "v0.0.0" after writing release-it, and publishing into repository ? HOT 7
- Return different message when requireCommitsFail is false HOT 1
- Commits to one dir generate release of another. HOT 2
- Programatic Usage: Release-Version Premature Exit HOT 1
- Can't quite get auto-changelog right in github release notes. githubRelease runs before git commit/tag HOT 8
- Can't upload github release assets without rewriting release's changelog HOT 2
- Error 405 (Method Not Allowed) when creating Gitlab release (Gitlab self-hosted) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from release-it.