Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git-command stuck #95

Closed
Jpunt opened this issue Jun 3, 2015 · 8 comments
Closed

Git-command stuck #95

Jpunt opened this issue Jun 3, 2015 · 8 comments

Comments

@Jpunt
Copy link

Jpunt commented Jun 3, 2015

My shell gets stuck when running this command, but only sometimes:

commitVersion: {
  command: "git commit -am 'Release version <%= new_version %>' && git tag <%= new_version %> && git push && git push --tags",
},

new_version comes from task from grunt-prompt. The weird thing is, the commands are actually executed (i've got a new commit with that message, a new tag, and everything is pushed), but my shell doesn't get the callback:

Running "prompt:release" (prompt) task
? Current version is 1.0.13, what version do you wanna release? 1.0.14

Running "replace:version" (replace) task

Running "shell:commitVersion" (shell) task

What can I try to fix this?

@derpoho
Copy link

derpoho commented Jun 5, 2015

Same here.

Our Command executes git flow feature start "feature_name" and gets stuck although everything is done correctly.

Any fix?

@derpoho
Copy link

derpoho commented Jun 5, 2015

@Jpunt After a quick test i suggest you to use grunt-exec in the meantime until this is fixed.
It works for us and the commands are the same.

@silverwind
Copy link

Also had a command getting stuck: ncu -u which is npm-check-updates.

@silverwind
Copy link

Nevermind me, my issue seems with the module itself - raineorshine/npm-check-updates#119

@zenopopovici
Copy link

Nope, it's a grunt-shell issue. Also npm install breaks. This could be the reason: raineorshine/npm-check-updates#119

@silverwind
Copy link

I think the issue with ncu boils down to process.stdin.isTTY being undefined in processes spawned by exec, making is-stdin think there i something on stdin when there is not. grunt-shell's attempt to pipe stdin (process.stdin.pipe(cp.stdin)) to the child is fruitless because the exec command already has run by the point this pipe is attached.

I think the proper solution here would be to switch to spawn and define stdio stream handling inside the spawn options. Either that, or it's a node bug with isTTY (though undefined vs false doesn't change much for this bug).

@sindresorhus
Copy link
Owner

Closing as it seems it's a Node.js core problem and nothing we can do here.

@silverwind
Copy link

I think this should be fixed in this module or maybe a wrapper by calling stdin.end() on the ChildProcess. Any child process that waits on stdin will hang until stdin is explicitely closed:

https://nodejs.org/api/child_process.html#child_process_child_stdin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants