fix: 更新缓存文件路径的创建逻辑
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import { simpleRouter } from '@/app.ts';
|
||||
import http from 'http';
|
||||
import { useContextKey } from '@kevisual/context';
|
||||
import { useFileStore } from '@kevisual/use-config';
|
||||
export { simpleRouter };
|
||||
|
||||
export const cacheFilePath = useFileStore('cache-file', { needExists: true });
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
/**
|
||||
* 缓存文件路径
|
||||
*/
|
||||
const defaultCachePath = path.join(os.homedir(), '.envision', 'cache-file');
|
||||
if (!fs.existsSync(defaultCachePath)) {
|
||||
fs.mkdirSync(defaultCachePath, { recursive: true });
|
||||
}
|
||||
export const cacheFilePath = defaultCachePath;
|
||||
|
||||
/**
|
||||
* 事件客户端
|
||||
|
||||
Reference in New Issue
Block a user