1
0
mirror of synced 2024-11-30 17:34:30 +01:00

BAYSHORE_CONFIG_PATH

This commit is contained in:
Luna Nightshade 2023-06-21 16:52:33 +02:00
parent 284999a18e
commit fcecc8d598
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@
"private": false,
"scripts": {
"dev": "tsc && node dist",
"build": "tsc",
"build_protos": "tsc -p ./tsconfig.proto.json"
},
"devDependencies": {

View File

@ -1,4 +1,5 @@
import fs from 'fs';
import process from 'process';
export interface ConfigFile {
placeId: string;
@ -69,7 +70,10 @@ export class Config {
static load() {
console.log('Loading config file...');
let cfg = fs.readFileSync('./config.json', 'utf-8');
let cfgPath = process.env['BAYSHORE_CONFIG_PATH'];
if (!cfgPath)
cfgPath = './config.json';
let cfg = fs.readFileSync(cfgPath, 'utf-8');
let json = JSON.parse(cfg);
this.cfg = json as ConfigFile;
}