修复定时任务脚本跳转

This commit is contained in:
whyour 2023-01-29 10:57:08 +08:00
parent 8ad26267d8
commit 633b30269c

View File

@ -281,7 +281,9 @@ export function getCommandScript(
command: string,
): [string, string] | string | undefined {
const cmd = command.split(' ') as string[];
if (cmd[0] === 'task') {
if (cmd[1] === 'repo' || cmd[1] === 'raw') {
return cmd[2];
}
let scriptsPart = cmd.find((x) =>
['.js', '.ts', '.sh', '.py'].some((y) => x.endsWith(y)),
);
@ -300,7 +302,4 @@ export function getCommandScript(
p = '';
}
return [s, p];
} else if (cmd[1] === 'repo') {
return cmd[2];
}
}