Raif
Raif

Reputation: 9249

grunt.util.spawn command waiting for response

I am trying to run an exe file from the command prompt from within a grunt task. What I have so far is

 var done = this.async();
 var cp = grunt.util.spawn({
            cmd: path.resolve(options.RH)
     }, done );

 cp.stdout.on('data', function (data) {
     grunt.verbose.writeln('stdout: ' + data.toString());
 });

(there will be args and more interesting stuff later but for now I just want it to run)

It does run and returns the output, however, exe that is running writes a message and then says "to continue please press enter".

This is as far as I get. It just hangs. Is there a way, to spawn a child that requires input?

I hope this is enough to go on, if not please let me know.

Upvotes: 2

Views: 855

Answers (1)

Raif
Raif

Reputation: 9249

Not sure if this is the right way to do it ( reference another post ) but it looks like my question is answered here. How to run commands via NodeJS child process?

Upvotes: 1

Related Questions