This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/node_modules/spawn-command/lib/spawn-command.js
2025-06-13 14:04:40 +08:00

18 lines
437 B
JavaScript

var util = require('util');
var spawn = require('child_process').spawn;
module.exports = function (command, options) {
var file, args;
if (process.platform === 'win32') {
file = 'cmd.exe';
args = ['/s', '/c', '"' + command + '"'];
options = util._extend({}, options);
options.windowsVerbatimArguments = true;
}
else {
file = '/bin/sh';
args = ['-c', command];
}
return spawn(file, args, options);
};