Last active
August 29, 2015 14:00
-
-
Save WernerWenz/890f514f8af3515d8e6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn; | |
if (require('os').platform() == "win32") { | |
spawn = function(cmd, args, opts) { | |
var exec = require('child_process').exec; | |
var cmdargs = args.map(function(arg){ return '"' + arg.toString().replace('"', '""') + '"'}).join(' '); | |
var cmd = process.env.COMSPEC; | |
var fullcmd = cmd + ' /C "' + cmdargs + '"'; | |
exec(fullcmd, opts); | |
} | |
} | |
else | |
spawn = require('child_process').spawn; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment