|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import { Config } from 'ass-json';
|
|
|
|
|
import { FileData } from './types/definitions';
|
|
|
|
|
import fs from 'fs-extra';
|
|
|
|
|
import Path from 'path';
|
|
|
|
@ -16,7 +17,9 @@ const { HTTP, HTTPS, KILOBYTES } = require('../MagicNumbers.json');
|
|
|
|
|
// Catch config.json not existing when running setup script
|
|
|
|
|
try {
|
|
|
|
|
// todo: fix this
|
|
|
|
|
var { useSsl, port, domain, isProxied, diskFilePath, s3bucket, s3endpoint, s3usePathStyle } = require('../config.json'); // skipcq: JS-0239, JS-0102
|
|
|
|
|
const configPath = Path.join(process.cwd(), 'config.json');
|
|
|
|
|
if (!fs.existsSync(configPath)) throw new Error('Config file not found');
|
|
|
|
|
var { useSsl, port, domain, isProxied, diskFilePath, s3bucket, s3endpoint, s3usePathStyle }: Config = fs.readJsonSync(configPath);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
if (ex.code !== 'MODULE_NOT_FOUND' || !ex.toString().includes('Unexpected end')) console.error(ex);
|
|
|
|
|