From 827e3ebd54d5c26c3a70e22e10c7761baa7c3ae8 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 7 Oct 2016 11:28:37 -0400 Subject: [PATCH] Use posix paths for dealing with modules. Let the underlying subsystem deal with the `path.sep` differences, the logic here was incorrectly interchanging `\` and `/` on windows. --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2a40700d..6ced6258 100644 --- a/index.js +++ b/index.js @@ -129,8 +129,9 @@ module.exports = { * @param {String} relativePath - path to file within current app * @returns {Boolean} whether or not the file exists within the current app */ - _doesFileExistIsCurrentProjectAddonModule: function(relativePath) { - relativePath = path.join('addon', relativePath.replace(path.join('modules', this.project.pkg.name),'')); + _doesFileExistIsCurrentProjectAddonModule: function(_relativePath) { + var relativePathWithoutProjectNamePrefix = _relativePath.replace('modules' + '/' + this.project.pkg.name, ''); + var relativePath = 'addon/' + relativePathWithoutProjectNamePrefix; if (this._existsSync(relativePath)) { return true;