mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复定时任务脚本跳转
This commit is contained in:
parent
8ad26267d8
commit
633b30269c
|
@ -152,9 +152,9 @@ export default function browserType() {
|
||||||
shell === 'none'
|
shell === 'none'
|
||||||
? {}
|
? {}
|
||||||
: {
|
: {
|
||||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||||
shellVs,
|
shellVs,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -281,26 +281,25 @@ export function getCommandScript(
|
||||||
command: string,
|
command: string,
|
||||||
): [string, string] | string | undefined {
|
): [string, string] | string | undefined {
|
||||||
const cmd = command.split(' ') as string[];
|
const cmd = command.split(' ') as string[];
|
||||||
if (cmd[0] === 'task') {
|
if (cmd[1] === 'repo' || cmd[1] === 'raw') {
|
||||||
let scriptsPart = cmd.find((x) =>
|
|
||||||
['.js', '.ts', '.sh', '.py'].some((y) => x.endsWith(y)),
|
|
||||||
);
|
|
||||||
if (!scriptsPart) return;
|
|
||||||
if (scriptsPart.startsWith('/ql/data/scripts')) {
|
|
||||||
scriptsPart = scriptsPart.replace('/ql/data/scripts/', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
let p: string, s: string;
|
|
||||||
let index = scriptsPart.lastIndexOf('/');
|
|
||||||
if (index >= 0) {
|
|
||||||
s = scriptsPart.slice(index + 1);
|
|
||||||
p = scriptsPart.slice(0, index);
|
|
||||||
} else {
|
|
||||||
s = scriptsPart;
|
|
||||||
p = '';
|
|
||||||
}
|
|
||||||
return [s, p];
|
|
||||||
} else if (cmd[1] === 'repo') {
|
|
||||||
return cmd[2];
|
return cmd[2];
|
||||||
}
|
}
|
||||||
|
let scriptsPart = cmd.find((x) =>
|
||||||
|
['.js', '.ts', '.sh', '.py'].some((y) => x.endsWith(y)),
|
||||||
|
);
|
||||||
|
if (!scriptsPart) return;
|
||||||
|
if (scriptsPart.startsWith('/ql/data/scripts')) {
|
||||||
|
scriptsPart = scriptsPart.replace('/ql/data/scripts/', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
let p: string, s: string;
|
||||||
|
let index = scriptsPart.lastIndexOf('/');
|
||||||
|
if (index >= 0) {
|
||||||
|
s = scriptsPart.slice(index + 1);
|
||||||
|
p = scriptsPart.slice(0, index);
|
||||||
|
} else {
|
||||||
|
s = scriptsPart;
|
||||||
|
p = '';
|
||||||
|
}
|
||||||
|
return [s, p];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user