Permalink
Browse files

[api] Implementation

  • Loading branch information...
1 parent bf5d18d commit 9ec16f8cd84bc2838a63a0b145c3e146bb9d08ae @mmalecki committed Jun 20, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/spawn-command.js
View
14 lib/spawn-command.js
@@ -0,0 +1,14 @@
+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 + '"'];
+ }
+ else {
+ file = '/bin/sh';
+ args = ['-c', command];
+ }
+ return spawn(file, args, options);
+};

0 comments on commit 9ec16f8

Please sign in to comment.