GithubHelp home page GithubHelp logo

not working in git-bash about release-it HOT 8 CLOSED

release-it avatar release-it commented on May 17, 2024
not working in git-bash

from release-it.

Comments (8)

webpro avatar webpro commented on May 17, 2024

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.

mlarcher avatar mlarcher commented on May 17, 2024

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.

webpro avatar webpro commented on May 17, 2024

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.

mlarcher avatar mlarcher commented on May 17, 2024

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.

webpro avatar webpro commented on May 17, 2024

Closing, since I'm pretty sure there's not much we can do in this project. Feel free to discuss, though.

from release-it.

mlarcher avatar mlarcher commented on May 17, 2024

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.

webpro avatar webpro commented on May 17, 2024

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.

mlarcher avatar mlarcher commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.