修复 data 目录判断逻辑

This commit is contained in:
whyour
2024-06-25 22:25:36 +08:00
parent 0d492e94f4
commit 7efe81df9e
5 changed files with 26 additions and 11 deletions
+6 -1
View File
@@ -19,7 +19,12 @@ const lastVersionFile = `https://qn.whyour.cn/version.yaml`;
const rootPath = process.env.QL_DIR as string;
const envFound = dotenv.config({ path: path.join(rootPath, '.env') });
const dataPath = path.join(rootPath, 'data/');
let dataPath = path.join(rootPath, 'data/');
if (process.env.QL_DATA_DIR) {
dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
}
const shellPath = path.join(rootPath, 'shell/');
const tmpPath = path.join(rootPath, '.tmp/');
const samplePath = path.join(rootPath, 'sample/');