Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit ccc514e

Browse files
committed
update ui.findFile to support looking up the @demos directory location
Fixes #1021
1 parent ff4049b commit ccc514e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/content/js/ui.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,8 @@ const ui = (function() {
18331833
}
18341834
} else if (filepath.charAt(0) === '@') {
18351835
// ui.js is in the /app/build directory
1836-
const desiredPrefix = require('path').dirname(filepath)
1836+
// the === '.' part handles the case where the call was e.g. ui.findFile('@demos'), i.e. the special dir itself
1837+
const desiredPrefix = require('path').dirname(filepath) === '.' ? filepath : require('path').dirname(filepath)
18371838
const special = specialPaths.find(({prefix}) => desiredPrefix.indexOf(prefix) === 0) || defaultSpecial
18381839
return require('path').join(special.filepath, filepath)
18391840
} else {

0 commit comments

Comments
 (0)