feat(boot): Bot now can be run with VSCode F5 after cloning from git.

This commit is contained in:
Rodrigo 2019-07-23 14:41:39 +00:00 committed by Rodrigo Rodriguez
parent 0df9aed9df
commit 29d90db689
5 changed files with 61 additions and 6 deletions

View file

@ -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) ## [1.5.4](https://github.com/pragmatismo-io/BotServer/compare/1.5.3...1.5.4) (2019-07-19)

51
boot.js
View file

@ -1,4 +1,49 @@
#! /usr/bin / env node #! /usr/bin / env node
const GBServer = require("./dist/src/app").GBServer
process.env.PWD = __dirname; const Fs = require('fs');
GBServer.run(); 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
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "botserver", "name": "botserver",
"version": "1.3.10", "version": "1.5.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "botserver", "name": "botserver",
"version": "1.5.4", "version": "1.5.5",
"description": "General Bot Community Edition open-core server.", "description": "General Bot Community Edition open-core server.",
"main": "./boot.js", "main": "./boot.js",
"bugs": "https://github.com/pragmatismo-io/BotServer/issues", "bugs": "https://github.com/pragmatismo-io/BotServer/issues",

View file

@ -123,7 +123,10 @@ export class GBConfigService {
case 'STORAGE_ENCRYPT': case 'STORAGE_ENCRYPT':
value = 'true'; value = 'true';
break; break;
default: case 'REVERSE_PROXY':
value = undefined;
break;
default:
GBLog.warn(`Invalid key on .env file: '${key}'`); GBLog.warn(`Invalid key on .env file: '${key}'`);
break; break;
} }