mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
silly closures...
This commit is contained in:
@@ -223,13 +223,16 @@ var express = require('express'),
|
|||||||
async.each(themes, function(themeObj, next) {
|
async.each(themes, function(themeObj, next) {
|
||||||
if (themeObj.screenshot) {
|
if (themeObj.screenshot) {
|
||||||
screenshotPath = path.join(__dirname, '../node_modules', themeObj.id, themeObj.screenshot);
|
screenshotPath = path.join(__dirname, '../node_modules', themeObj.id, themeObj.screenshot);
|
||||||
fs.exists(screenshotPath, function(exists) {
|
(function(id, path) {
|
||||||
|
fs.exists(path, function(exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
app.get('/css/previews/' + themeObj.id, function(req, res) {
|
console.log('routing', id, path);
|
||||||
res.sendfile(screenshotPath);
|
app.get('/css/previews/' + id, function(req, res) {
|
||||||
|
res.sendfile(path);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
})(themeObj.id, screenshotPath);
|
||||||
} else {
|
} else {
|
||||||
next(false);
|
next(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user