Permalink
Browse files

use spawn for plugin install

  • Loading branch information...
Hsiaoming Yang
Hsiaoming Yang committed Mar 27, 2013
1 parent f6e0b55 commit 2cfe321c7ec1eaabd6ffd60921bece93012dd7b5
Showing with 5 additions and 5 deletions.
  1. +5 −5 bin/spm-plugin
View
@@ -48,9 +48,9 @@ if (!subcmd) {
}
function install(plugin) {
- var exec = require('child_process').exec;
- exec('npm install spm-' + plugin + ' -g', function(err, stdout, stderr) {
- console.info(stdout);
- console.error(stderr);
- });
+ if (!/^spm-/.test(plugin)) {
+ plugin = 'spm-' + plugin;
+ }
+ var spawn = require('win-spawn');
+ spawn('npm', ['install', '-g', plugin], {stdio: 'inherit', customFds: [0, 1, 2]});
}

0 comments on commit 2cfe321

Please sign in to comment.