修改QL_DIR环境变量

This commit is contained in:
whyour
2022-07-18 14:02:00 +08:00
parent 2d3ebe6087
commit 027c3f584c
2 changed files with 9 additions and 10 deletions
+1 -9
View File
@@ -5,7 +5,7 @@ import dotenv from 'dotenv';
import Logger from './logger';
import { fileExist } from '../config/util';
const rootPath = process.cwd();
const rootPath = process.env.QL_DIR as string;;
const dataPath = path.join(rootPath, 'data/');
const configPath = path.join(dataPath, 'config/');
const scriptPath = path.join(dataPath, 'scripts/');
@@ -64,13 +64,5 @@ export default async () => {
dotenv.config({ path: confFile });
// 声明QL_DIR环境变量
let qlHomePath = path.join(__dirname, '../../');
// 生产环境
if (qlHomePath.endsWith('/static/')) {
qlHomePath = path.join(qlHomePath, '../');
}
process.env.QL_DIR = qlHomePath;
Logger.info('✌️ Init file down');
};