Skip to content

Commit

Permalink
feat(boot): Bot now can be run with VSCode F5 after cloning from git.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo authored and rodrigorodriguez committed Aug 21, 2019
1 parent 0df9aed commit 29d90db
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.5.5](https://github.com/pragmatismo-io/BotServer/compare/1.5.4...1.5.5) (2019-07-23)


### Bug Fixes

* **kb.gbapp:** Improvement on translate ([bc56a1d](https://github.com/pragmatismo-io/BotServer/commit/bc56a1d))

## [1.5.4](https://github.com/pragmatismo-io/BotServer/compare/1.5.3...1.5.4) (2019-07-19)


Expand Down
51 changes: 48 additions & 3 deletions boot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
#! /usr/bin / env node
const GBServer = require("./dist/src/app").GBServer
process.env.PWD = __dirname;
GBServer.run();

const Fs = require('fs');
const Path = require('path');
const { exec } = require('child_process');

try {

var run = () => {
const GBServer = require("./dist/src/app").GBServer
process.env.PWD = __dirname;
GBServer.run();
}

var processDist = () => {
if (!Fs.existsSync('dist')) {
console.log(`Compiling...`);
exec(Path.join(__dirname, 'node_modules/.bin/tsc'), (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
run();
});
}
else {
run();
}
};

if (!Fs.existsSync('node_modules')) {
console.log(`Installing modules for the first time, please wait...`);
exec('npm install', (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
processDist();
});
}
else {
processDist();
}
}
catch (e) {
console.log(e);
}


2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botserver",
"version": "1.5.4",
"version": "1.5.5",
"description": "General Bot Community Edition open-core server.",
"main": "./boot.js",
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",
Expand Down
5 changes: 4 additions & 1 deletion packages/core.gbapp/services/GBConfigService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ export class GBConfigService {
case 'STORAGE_ENCRYPT':
value = 'true';
break;
default:
case 'REVERSE_PROXY':
value = undefined;
break;
default:
GBLog.warn(`Invalid key on .env file: '${key}'`);
break;
}
Expand Down

0 comments on commit 29d90db

Please sign in to comment.