mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-04 05:39:51 +01:00
unnecessary property check
This commit is contained in:
@@ -185,25 +185,23 @@ var fs = require('fs'),
|
||||
}
|
||||
|
||||
function mapStaticDirs(mappedPath) {
|
||||
if (pluginData.staticDirs.hasOwnProperty(mappedPath)) {
|
||||
if (Plugins.staticDirs[mappedPath]) {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path (' + mappedPath + ') already specified!');
|
||||
} else if (!validMappedPath.test(mappedPath)) {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: ' + mappedPath + '. Path must adhere to: ' + validMappedPath.toString());
|
||||
} else {
|
||||
realPath = pluginData.staticDirs[mappedPath];
|
||||
staticDir = path.join(pluginPath, realPath);
|
||||
if (Plugins.staticDirs[mappedPath]) {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path (' + mappedPath + ') already specified!');
|
||||
} else if (!validMappedPath.test(mappedPath)) {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: ' + mappedPath + '. Path must adhere to: ' + validMappedPath.toString());
|
||||
} else {
|
||||
realPath = pluginData.staticDirs[mappedPath];
|
||||
staticDir = path.join(pluginPath, realPath);
|
||||
|
||||
(function(staticDir) {
|
||||
fs.exists(staticDir, function(exists) {
|
||||
if (exists) {
|
||||
Plugins.staticDirs[pluginData.id + '/' + mappedPath] = staticDir;
|
||||
} else {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' + mappedPath + ' => ' + staticDir + '\' not found.');
|
||||
}
|
||||
});
|
||||
}(staticDir));
|
||||
}
|
||||
(function(staticDir) {
|
||||
fs.exists(staticDir, function(exists) {
|
||||
if (exists) {
|
||||
Plugins.staticDirs[pluginData.id + '/' + mappedPath] = staticDir;
|
||||
} else {
|
||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' + mappedPath + ' => ' + staticDir + '\' not found.');
|
||||
}
|
||||
});
|
||||
}(staticDir));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user