mirror of
https://github.com/whyour/qinglong.git
synced 2025-08-23 11:48:14 +08:00
修改QL_DIR环境变量
This commit is contained in:
parent
2d3ebe6087
commit
027c3f584c
|
@ -3,11 +3,18 @@ import path from 'path';
|
||||||
import { createRandomString } from './util';
|
import { createRandomString } from './util';
|
||||||
|
|
||||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||||
|
// 声明QL_DIR环境变量
|
||||||
|
let qlHomePath = path.join(__dirname, '../../');
|
||||||
|
// 生产环境
|
||||||
|
if (qlHomePath.endsWith('/static/')) {
|
||||||
|
qlHomePath = path.join(qlHomePath, '../');
|
||||||
|
}
|
||||||
|
process.env.QL_DIR = qlHomePath;
|
||||||
|
|
||||||
const lastVersionFile = `http://qn.whyour.cn/version.ts?v=${Date.now()}`;
|
const lastVersionFile = `http://qn.whyour.cn/version.ts?v=${Date.now()}`;
|
||||||
|
|
||||||
const envFound = dotenv.config();
|
const envFound = dotenv.config();
|
||||||
const rootPath = process.cwd();
|
const rootPath = qlHomePath;
|
||||||
const dataPath = path.join(rootPath, 'data/');
|
const dataPath = path.join(rootPath, 'data/');
|
||||||
const samplePath = path.join(rootPath, 'sample/');
|
const samplePath = path.join(rootPath, 'sample/');
|
||||||
const configPath = path.join(dataPath, 'config/');
|
const configPath = path.join(dataPath, 'config/');
|
||||||
|
|
|
@ -5,7 +5,7 @@ import dotenv from 'dotenv';
|
||||||
import Logger from './logger';
|
import Logger from './logger';
|
||||||
import { fileExist } from '../config/util';
|
import { fileExist } from '../config/util';
|
||||||
|
|
||||||
const rootPath = process.cwd();
|
const rootPath = process.env.QL_DIR as string;;
|
||||||
const dataPath = path.join(rootPath, 'data/');
|
const dataPath = path.join(rootPath, 'data/');
|
||||||
const configPath = path.join(dataPath, 'config/');
|
const configPath = path.join(dataPath, 'config/');
|
||||||
const scriptPath = path.join(dataPath, 'scripts/');
|
const scriptPath = path.join(dataPath, 'scripts/');
|
||||||
|
@ -64,13 +64,5 @@ export default async () => {
|
||||||
|
|
||||||
dotenv.config({ path: confFile });
|
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');
|
Logger.info('✌️ Init file down');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user