Reputation: 2271
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
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