Fixed bug in public folder resolution

This commit is contained in:
DallonF
2012-11-02 13:57:29 -07:00
parent f33979e82b
commit 2356e21ea5

View File

@@ -153,8 +153,11 @@ function addInternalResources(server, basepath, resources, fn) {
if (server.options && server.options.env) {
var altPublic = server.options && './public-' + server.options.env;
var altPublicExistsQ = Q.ninvoke(fs, 'exists', altPublic);
return altPublicExistsQ.then(function(exists) {
var altPublicExistsQ = Q.defer();
fs.exists(altPublic, function(exists) {
altPublicExistsQ.resolve(exists);
});
return altPublicExistsQ.promise.then(function(exists) {
if (exists) {
return altPublic;
} else {