Skip to content
Merged
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
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,23 @@ module.exports = {

return this._doesTemplateFileExist(relativePath);
},
/**

/**
* Check if a file exists within the current addon directory. Removing `module/<app-name>` from the path.
* @param {String} relativePath - path to file within current app
* @returns {Boolean} whether or not the file exists within the current app
*/
_doesFileExistIsCurrentProjectAddonModule: function(_relativePath) {
var relativePathWithoutProjectNamePrefix = _relativePath.replace('modules' + '/' + this._parentName(), '');
var relativePath = 'addon/' + relativePathWithoutProjectNamePrefix;
_doesFileExistInCurrentProjectAddonModule: function(relativePath) {
var relativePathWithoutProjectNamePrefix = relativePath.replace('modules' + '/' + this._parentName(), '');
var _relativePath = 'addon/' + relativePathWithoutProjectNamePrefix;

if (this._existsSync(relativePath)) {
if (this._existsSync(_relativePath)) {
return true;
}

return this._doesTemplateFileExist(relativePath);
return this._doesTemplateFileExist(_relativePath);
},

/**
* Check if a file exists within the dummy app
* @param {String} relativePath - path to file within dummy app
Expand Down Expand Up @@ -204,7 +206,7 @@ module.exports = {
this._doesFileExistInDummyApp(relativePath) ||
this._doesFileExistInCurrentProjectApp(relativePath) ||
this._doesFileExistInCurrentProjectAddon(relativePath) ||
this._doesFileExistIsCurrentProjectAddonModule(relativePath)
this._doesFileExistInCurrentProjectAddonModule(relativePath)
);

return !fileExists;
Expand Down