mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-30 03:09:53 +01:00
for #944
This commit is contained in:
11
src/meta.js
11
src/meta.js
@@ -251,14 +251,19 @@ var fs = require('fs'),
|
||||
var paths = jsPath.split('/'),
|
||||
mappedPath = paths[1];
|
||||
|
||||
jsPath = jsPath.replace(path.join('plugins', mappedPath), '');
|
||||
return path.join(plugins.staticDirs[mappedPath], jsPath);
|
||||
if (plugins.staticDirs[mappedPath]) {
|
||||
jsPath = jsPath.replace(path.join('plugins', mappedPath), '');
|
||||
return path.join(plugins.staticDirs[mappedPath], jsPath);
|
||||
} else {
|
||||
winston.warn('[meta.scripts.get] Could not resolve mapped path: ' + mappedPath + '. Are you sure it is defined by a plugin?');
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return path.join(__dirname, '..', '/public', jsPath);
|
||||
}
|
||||
});
|
||||
|
||||
Meta.js.scripts = jsPaths;
|
||||
Meta.js.scripts = jsPaths.filter(function(path) { return path !== null });
|
||||
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
async.parallel({
|
||||
|
||||
Reference in New Issue
Block a user