mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复任务命令带有 -m 参数时,日志目录生成异常
This commit is contained in:
parent
418695c4aa
commit
3f71f9acdb
|
@ -469,13 +469,18 @@ export async function getUniqPath(
|
|||
command: string,
|
||||
id: string,
|
||||
): Promise<string> {
|
||||
let suffix = '';
|
||||
if (/^\d+$/.test(id)) {
|
||||
id = `_${id}`;
|
||||
} else {
|
||||
id = '';
|
||||
suffix = `_${id}`;
|
||||
}
|
||||
|
||||
let items = command.split(/ +/);
|
||||
|
||||
const maxTimeCommandIndex = items.findIndex((x) => x === '-m');
|
||||
if (maxTimeCommandIndex !== -1) {
|
||||
items = items.slice(maxTimeCommandIndex + 2);
|
||||
}
|
||||
|
||||
const items = command.split(/ +/);
|
||||
let str = items[0];
|
||||
if (items[0] === TASK_COMMAND) {
|
||||
str = items[1];
|
||||
|
@ -499,7 +504,7 @@ export async function getUniqPath(
|
|||
str = `${tempStr}_${str.slice(slashIndex + 1)}`;
|
||||
}
|
||||
|
||||
return `${str}${id}`;
|
||||
return `${str}${suffix}`;
|
||||
}
|
||||
|
||||
export function safeJSONParse(value?: string) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user