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

shelljs.exec hangs when password it's asked #716

Closed
napcat opened this issue May 3, 2017 · 6 comments
Closed

shelljs.exec hangs when password it's asked #716

napcat opened this issue May 3, 2017 · 6 comments
Assignees
Labels
duplicate exec Issues specific to the shell.exec() API

Comments

@napcat
Copy link

napcat commented May 3, 2017

Node version (or tell us if you're using electron or some other framework):

v6.10.2

ShellJS version (the most recent version/Github branch you see the bug on):

Most recent: 0.7.7

Operating system:

Windows 10

Description of the bug:

I have a node js script and I'm trying to exec a command to get some facebook hash keys.
When the command runs it needs the user to input the password, but the script hangs and stop runnning. The password action does not show any chars that are being written.

Example ShellJS command to reproduce the error:

var path          = require('path');
var os              = require('os');

var homedir = os.homedir();

var command = 'keytool -exportcert -alias androiddebugkey -keystore ' 
+ path.join(homedir, '\\.android\\debug.keystore') 
+ ' | openssl sha1 -binary | openssl base64';

shelljs.exec(command);
@nfischer
Copy link
Member

nfischer commented May 3, 2017

We don't support interactive programs with exec(). This will hopefully be addressed in an alternative to exec.

@nfischer nfischer added the exec Issues specific to the shell.exec() API label May 3, 2017
@protoEvangelion
Copy link

@nfischer Are there any updates or workarounds for this?

@nfischer nfischer self-assigned this Oct 17, 2017
@nfischer
Copy link
Member

I'll write a FAQ for interactive programs.

@protoEvangelion
Copy link

Thanks @nfischer.

Idk if this would be helpful, but I was able to get it to work using the 'exec-sh' package just by doing: execSh(myCmd)

Maybe their implementation would help :)

@nfischer
Copy link
Member

Workaround is in the FAQs: https://github.com/shelljs/shelljs/wiki/FAQ#running-interactive-programs-with-exec

Let me know if this doesn't work.

Duplicate of #424.

@nfischer
Copy link
Member

Duplicate of #424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate exec Issues specific to the shell.exec() API
Projects
None yet
Development

No branches or pull requests

3 participants