feat: 更新版本号和依赖项,重构keepAliveFilePath路径以支持新的目录结构
This commit is contained in:
@@ -16,8 +16,8 @@ export type KeepAliveData = {
|
||||
type KeepAliveCache = {
|
||||
data: KeepAliveData[];
|
||||
}
|
||||
|
||||
const keepAliveFilePath = path.join(os.homedir(), '.cnb/keepAliveCache.json');
|
||||
const baseDir = path.join(os.homedir(), '.cnb', 'live');
|
||||
const keepAliveFilePath = path.join(baseDir, 'keepAliveCache.json');
|
||||
|
||||
export const runLive = (filePath: string, pm2Name: string) => {
|
||||
// 使用 npx 运行命令
|
||||
@@ -109,7 +109,7 @@ export const createLiveData = (data: { cookie: string, repo: string, pipelineId:
|
||||
const createdTime = Date.now();
|
||||
const wsUrl = `wss://${pipelineId}.cnb.space:443?skipWebSocketFrames=false`;
|
||||
const pm2Name = `keep_${repo}__${pipelineId}`.replace(/\//g, '__');
|
||||
const filePath = path.join(os.homedir(), '.cnb', `${pm2Name}.json`);
|
||||
const filePath = path.join(baseDir, `${pm2Name}.json`);
|
||||
const _newData = { wss: wsUrl, wsUrl, cookie, repo, pipelineId, createdTime, filePath, pm2Name };
|
||||
if (!fs.existsSync(path.dirname(filePath))) {
|
||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user