fix(core.gbapp): Fix in deploy.

This commit is contained in:
Rodrigo Rodriguez 2020-04-03 09:58:14 -03:00
parent c6d3086fa0
commit 9d5d754d92
2 changed files with 22 additions and 25 deletions

View file

@ -528,12 +528,11 @@ export class GBDeployer implements IGBDeployer {
} }
} }
folder = Path.join(e, 'dist'); folder = Path.join(e, 'dist');
if (!Fs.existsSync()) {
try { try {
GBLog.info(`process.env.GBAPP_DISABLE_COMPILE: ${process.env.GBAPP_DISABLE_COMPILE}`); if (process.env.GBAPP_DISABLE_COMPILE !== "true") {
if (process.env.GBAPP_DISABLE_COMPILE !== "true" && false) { GBLog.info(`Compiling .gbapp: ${e}.`);
child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e }); child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e });
} }
const m = await import(e); const m = await import(e);
@ -547,9 +546,6 @@ export class GBDeployer implements IGBDeployer {
appPackagesProcessed++; appPackagesProcessed++;
} }
} }
} else {
appPackagesProcessed++;
}
}); });
return appPackagesProcessed; return appPackagesProcessed;

View file

@ -209,7 +209,7 @@ export class GBMinService {
// this.deployer.deployPackage(min, 'packages/default.gbdialog'); // this.deployer.deployPackage(min, 'packages/default.gbdialog');
// Call the loadBot context.activity for all packages. // Call the loadBot context.activity for all packages.
await this.invokeLoadBot(GBServer.globals.appPackages, GBServer.globals.sysPackages, min); this.invokeLoadBot(GBServer.globals.appPackages, GBServer.globals.sysPackages, min);
// Serves individual URL for each bot conversational interface... // Serves individual URL for each bot conversational interface...
const url = `/api/messages/${instance.botId}`; const url = `/api/messages/${instance.botId}`;
@ -424,11 +424,12 @@ export class GBMinService {
return { min, adapter, conversationState }; return { min, adapter, conversationState };
} }
private async invokeLoadBot(appPackages: IGBPackage[], sysPackages: IGBPackage[], min: GBMinInstance) { private invokeLoadBot(appPackages: IGBPackage[], sysPackages: IGBPackage[], min: GBMinInstance) {
await CollectionUtil.asyncForEach(sysPackages, async e => { sysPackages.forEach(e => {
e.loadBot(min); e.loadBot(min);
}); }, this);
await CollectionUtil.asyncForEach(appPackages, async p => {
appPackages.forEach(p => {
p.sysPackages = sysPackages; p.sysPackages = sysPackages;
p.loadBot(min); p.loadBot(min);
if (p.getDialogs !== undefined) { if (p.getDialogs !== undefined) {
@ -437,7 +438,7 @@ export class GBMinService {
min.dialogs.add(new WaterfallDialog(dialog.id, dialog.waterfall)); min.dialogs.add(new WaterfallDialog(dialog.id, dialog.waterfall));
}); });
} }
}); }, this);
} }
/** /**