From 4fd580e4ed7a81993390a513c73686e10a1de19a Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 12 Jun 2021 16:26:53 +0800 Subject: [PATCH] judge: fix? --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/hosts/hydro.ts | 2 +- packages/hydrojudge/src/judge/interactive.ts | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 579d0e6e3..3df5197eb 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.8.4", + "version": "2.8.5", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/hosts/hydro.ts b/packages/hydrojudge/src/hosts/hydro.ts index f0d24450e..9733fbe54 100644 --- a/packages/hydrojudge/src/hosts/hydro.ts +++ b/packages/hydrojudge/src/hosts/hydro.ts @@ -206,7 +206,7 @@ export default class Hydro { if (etags[file.name] !== file.etag + file.lastModified) filenames.push(file.name); } for (const name in etags) { - if (!allFiles.has(name)) await fs.rm(path.join(filePath, name)); + if (!allFiles.has(name) && fs.existsSync(path.join(filePath, name))) await fs.rm(path.join(filePath, name)); } if (filenames.length) { log.info(`Getting problem data: ${this.config.host}/${domainId}/${pid}`); diff --git a/packages/hydrojudge/src/judge/interactive.ts b/packages/hydrojudge/src/judge/interactive.ts index 9819b03fb..e6b62a087 100644 --- a/packages/hydrojudge/src/judge/interactive.ts +++ b/packages/hydrojudge/src/judge/interactive.ts @@ -26,12 +26,14 @@ function judgeCase(c) { time: ctxSubtask.subtask.time, memory: ctxSubtask.subtask.memory, }, { - execute: `${ctx.executeInteractor.execute.replace(/\$\{name\}/g, 'interactor')} /w/in /w/tout`, + execute: `${ctx.executeInteractor.execute.replace(/\$\{name\}/g, 'interactor')} /w/in /w/tout /w/tout`, copyIn: ctx.executeInteractor.copyIn, time: ctxSubtask.subtask.time * 2, memory: ctxSubtask.subtask.memory * 2, + copyOut: ['/w/tout?'], }, ]); + // TODO handle tout (maybe pass to checker?) let status; let score = 0; let message: any = '';