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