mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
judge: submit_answer: support wildcard filename
This commit is contained in:
1 parent
76be3ebbb1
commit
39c5e7661b
2 files changed
+4
-2
No files matched your search
@@ -35,7 +35,9 @@ function judgeCase(c: Case, sid: string) {
|
||||
return;
|
||||
}
|
||||
const chars = /[a-zA-Z0-9_.-]/;
|
||||
const name = await readFile(c.input, 'utf-8').then((res) => res.trim().split('').filter((i) => chars.test(i)).join(''));
|
||||
const name = (ctx.config.filename && /^[a-zA-Z0-9-_#.]+$/.test(ctx.config.filename))
|
||||
? ctx.config.filename.replace('#', c.id.toString())
|
||||
: await readFile(c.input, 'utf-8').then((res) => res.trim().split('').filter((i) => chars.test(i)).join(''));
|
||||
let file = ctx.code;
|
||||
let status = STATUS.STATUS_ACCEPTED;
|
||||
let message: any = '';
|
||||
|
||||
Reference in new issue
Block a user