Skip to content

Commit

Permalink
fix(kb.gbapp): Use of await style call
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-parana committed Oct 17, 2019
1 parent d29dea4 commit a034abf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 3 additions & 2 deletions packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class GBDeployer {

const dirs = getDirectories(path);
dirs.forEach(element => {
if (element.startsWith('.')) {
if (element === '.') {
GBLog.info(`Ignoring ${element}...`);
} else {
if (element.endsWith('.gbot')) {
Expand Down Expand Up @@ -494,7 +494,8 @@ export class GBDeployer {

try {
child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e });
import(e)
GBLog.info(`Importando o pacote '${e}' on dir ${process.env.PWD}`);
import(Path.join(process.env.PWD, e))
.then(m => {
const p = new m.Package();
p.loadPackage(core, core.sequelize);
Expand Down
10 changes: 1 addition & 9 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,7 @@ export class KBService {
}

public async addAnswer(obj: GuaribasAnswer): Promise<GuaribasAnswer> {
return new Promise<GuaribasAnswer>((resolve, reject) => {
GuaribasAnswer.create(obj)
.then(item => {
resolve(item);
})
.error(reason => {
reject(reason);
});
});
return await GuaribasAnswer.create(obj);
}

public async ask(
Expand Down

0 comments on commit a034abf

Please sign in to comment.