Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/models/addon-test-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ AddonTestApp.prototype.create = function(appName, options) {
.then(() => this);
};

AddonTestApp.prototype.link = function(appName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to call it linkAddon or something like that, to disambiguate it a bit more

return pristine.link(appName)
.then(() => this);
};

AddonTestApp.prototype.editPackageJSON = function(cb) {
let packageJSONPath = path.join(this.path, 'package.json');
let pkg = fs.readJsonSync(packageJSONPath);
Expand Down
15 changes: 11 additions & 4 deletions lib/utilities/pristine.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,22 @@ function createApp(appName, options) {

return appInstallation.then(() => {
copyUnderTestApp(pristineAppPath, underTestAppPath);
return link(appName);
}).then(() => {
chdir(previousCwd);
return underTestAppPath;
});
}

function link(appName) {
return Promise.resolve()
.then(() => linkDependencies(appName))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this rather call symlinkAddon() here?

.then(runAddonGenerator);
}

module.exports = {
createApp
createApp,
link
};

function installPristineApp(appName, options) {
Expand Down Expand Up @@ -108,9 +117,7 @@ function installPristineApp(appName, options) {

// All dependencies should be installed, so symlink them into the app and
// run the addon's blueprint to finish the app creation.
return promise
.then(() => linkDependencies(appName))
.then(runAddonGenerator);
return promise;
}

// Generates the arguments to pass to `ember new`. Optionally skipping the
Expand Down