Skip to content

Commit c68be47

Browse files
committed
bugfix with dirPath
1 parent 6f0beb1 commit c68be47

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

lib/models/addon-test-app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ AddonTestApp.prototype.create = function(appName, options) {
2424

2525
return pristine.createApp(appName, options)
2626
.then(appPath => {
27+
if (!appPath) {
28+
return Promise.reject('createApp failed');
29+
}
2730
this.path = appPath;
2831
return options.noFixtures ?
2932
Promise.resolve() :

lib/utilities/pristine.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ const symlinkDirectory = require('./symlink-directory');
1212
const runCommand = require('./run-command');
1313
const runEmber = require('./run-ember');
1414
const runNew = require('./run-new');
15-
const semver = require('semver');
1615

17-
// As of [email protected], it no longer uses Bower by default
18-
const usesBower = semver.lt(require('ember-cli/package').version, '2.13.0');
16+
const usesBower = false;
1917
const runCommandOptions = {
2018
// Note: We must override the default logOnFailure logging, because we are
2119
// not inside a test.

lib/utilities/run-command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const exec = denodeify(childProcess.exec);
1313
const isWindows = process.platform === 'win32';
1414

1515
module.exports = function run(/* command, args, options */) {
16-
let command = arguments[0];
16+
let command = arguments[0] || 'node';
1717
let args = Array.prototype.slice.call(arguments, 1);
1818
let options = {};
1919

lib/utilities/run-ember.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ const findup = require('findup-sync');
55
const runCommand = require('./run-command');
66

77
module.exports = function(command, options, dirPath) {
8-
let emberCLIPath = findup('node_modules/ember-cli', {
9-
cwd: dirPath || __dirname
10-
});
8+
let cwd = __dirname;
9+
if (dirPath && dirPath.startsWith(__dirname)) {
10+
cwd = dirPath;
11+
}
12+
let emberCLIPath = findup('node_modules/ember-cli', { cwd });
1113

12-
let args = [path.join(emberCLIPath, 'bin', 'ember'), command].concat(options);
14+
let args = ['node', path.join(emberCLIPath, 'bin', 'ember'), command].concat(options);
1315

1416
return runCommand.apply(undefined, args);
1517
};

0 commit comments

Comments
 (0)