mirror of
https://github.com/bower/bower.git
synced 2026-01-14 00:38:03 -05:00
[test] Replace sync-exec with spawn-sync
sync-exec has performance issue on Windows
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
"nock": "^0.56.0",
|
||||
"node-uuid": "^1.4.2",
|
||||
"proxyquire": "^1.3.0",
|
||||
"sync-exec": "^0.5.0"
|
||||
"spawn-sync": "^1.0.5"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
|
||||
@@ -12,7 +12,7 @@ var os = require('os');
|
||||
var which = require('which');
|
||||
var path = require('path');
|
||||
var proxyquire = require('proxyquire').noCallThru().noPreserveCache();
|
||||
var exec = require('sync-exec');
|
||||
var spawnSync = require('spawn-sync');
|
||||
var config = require('../lib/config');
|
||||
|
||||
// For better promise errors
|
||||
@@ -145,8 +145,13 @@ exports.TempDir = (function() {
|
||||
|
||||
TempDir.prototype.git = function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var result = spawnSync('git', args, { cwd: this.path });
|
||||
|
||||
return exec('cd ' + this.path + ' && git ' + args.join(' ')).stdout;
|
||||
if (result.status !== 0) {
|
||||
throw new Error(result.stderr);
|
||||
} else {
|
||||
return result.stdout.toString();
|
||||
}
|
||||
};
|
||||
|
||||
TempDir.prototype.exists = function (name) {
|
||||
|
||||
Reference in New Issue
Block a user