Skip to content

Commit

Permalink
fix: sometimes .trees['app'] is a string, and sometimes a node.
Browse files Browse the repository at this point in the history
  • Loading branch information
webark committed Sep 19, 2018
1 parent 7dc050f commit 7d92100
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/colocate-namespace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

const Funnel = require('broccoli-funnel');
const Merge = require('broccoli-merge-trees');
const StyleManifest = require('broccoli-style-manifest');
Expand Down Expand Up @@ -34,15 +36,16 @@ class ColocatedStyles {
}

projectNode(app) {
const projectPath = this.isAddon ? [
app.root,
app.treePaths['addon'],
].join('/') : [
app.project.root,
(app.app || app).trees['app'],
].join('/');

return new Funnel(projectPath);
if (this.isAddon) {
return new Funnel(path.join(app.root, app.treePaths['addon']));
} else {
const appTree = (app.app || app).trees['app'];
if (typeof appTree === 'string') {
return new Funnel(path.join(app.project.root, appTree));
} else {
return appTree;
}
}
}
}

Expand Down

0 comments on commit 7d92100

Please # to comment.