vjudge: add CheckService (#599)

This commit is contained in:
panda authored and GitHub committed 2023-06-30 00:52:25 +08:00
1 parent 807bfb53e3
commit 9da4340a97
8 files changed
+129 -62

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ export function register(cli: CAC) {
const url = new URL(src);
const filename = url.pathname.split('/').pop()!;
if (['.tar.gz', '.tgz', '.zip'].find((i) => filename.endsWith(i))) {
const name = filename.replace(/(-?\d+\.\d+\.\d+)?(\.tar\.gz|\.zip|\.tgz)$/g, '');
const name = filename.replace(/(-?(\d+\.\d+\.\d+|latest))?(\.tar\.gz|\.zip|\.tgz)$/g, '');
newAddonPath = path.join(addonDir, name);
logger.info(`Downloading ${src} to ${newAddonPath}`);
fs.ensureDirSync(newAddonPath);