elquimista
elquimista

Reputation: 2271

grunt.util.spawn NOT working on Windows

var child = grunt.util.spawn({
   cmd: 'echo %PATH%'
}, function(error, result, code) {
   cb(error, result.stdout);
});

When I executed 'echo %PATH%' in my windows command prompt, it works fine. But grunt.util.spawn is producing error like this:

>>Error: Error: not found: echo %PATH%

Tried googling over an hour, but no luck. Please help me.

Upvotes: 1

Views: 241

Answers (1)

mags
mags

Reputation: 630

I think you need "%PATH%" to be passed as an argument like this:

var child = grunt.util.spawn({
   cmd: 'echo', 
  args: ['%PATH%'],
}, function(error, result, code) {
   cb(error, result.stdout);
});

Upvotes: 1

Related Questions