diff --git a/src/ass.ts b/src/ass.ts index 78113ec..c6d357a 100644 --- a/src/ass.ts +++ b/src/ass.ts @@ -15,7 +15,7 @@ import { path, log, getTrueHttp, getTrueDomain } from './utils'; //#region Setup - Run first time setup if using Docker (pseudo-process, setup will be run with docker exec) import { doSetup } from './setup'; const configPath = path('config.json'); -if (!fs.existsSync(configPath)) { +if (!fs.existsSync(configPath) || fs.readFileSync(configPath).toString().length === 0) { doSetup(); // @ts-ignore return; diff --git a/src/utils.ts b/src/utils.ts index 9ad9579..c34a5ab 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -18,7 +18,7 @@ try { var { useSsl, port, domain, isProxied, diskFilePath, s3bucket, s3endpoint, s3usePathStyle } = require('../config.json'); // skipcq: JS-0239, JS-0102 } catch (ex) { // @ts-ignore - if (ex.code !== 'MODULE_NOT_FOUND') console.error(ex); + if (ex.code !== 'MODULE_NOT_FOUND' || Object.prototype.toString.call(ex).includes('Unexpected end of JSON input')) console.error(ex); } export function getTrueHttp() {