mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 21:06:16 +08:00
Added support for '/public-[env]' folder
This commit is contained in:
@@ -147,14 +147,18 @@ function loadResourceExtras(resource, fn) {
|
||||
}
|
||||
|
||||
function addInternalResources(server, basepath, resources, fn) {
|
||||
var internals = [
|
||||
new Files('', { config: { 'public': './public' }, server: server })
|
||||
, new ClientLib('dpd.js', { config: { resources: resources }, server: server})
|
||||
, new InternalResources('__resources', {config: {configPath: basepath}, server: server})
|
||||
, new Dashboard('dashboard', {server: server})
|
||||
];
|
||||
async.forEach(internals, loadResourceExtras, function(err) {
|
||||
fn(err, resources.concat(internals));
|
||||
var altPublic = './public-' + server.options.env;
|
||||
fs.exists(altPublic, function(exists) {
|
||||
var internals = [
|
||||
new Files('', { config: { 'public': exists ? altPublic : './public' }, server: server })
|
||||
, new ClientLib('dpd.js', { config: { resources: resources }, server: server})
|
||||
, new InternalResources('__resources', {config: {configPath: basepath}, server: server})
|
||||
, new Dashboard('dashboard', {server: server})
|
||||
];
|
||||
async.forEach(internals, loadResourceExtras, function(err) {
|
||||
fn(err, resources.concat(internals));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user