mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: problemconfig: support new CompilableSource
This commit is contained in:
1 parent
4a33816a37
commit
5c9cecc197
17 files changed
+252
-228
No files matched your search
@@ -6,6 +6,7 @@
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
"dependencies": {
|
||||
"@hydrooj/common": "workspace:^",
|
||||
"@hydrooj/utils": "workspace:^",
|
||||
"adm-zip": "0.5.14",
|
||||
"cac": "^6.7.14",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import path from 'path';
|
||||
import {
|
||||
convertIniConfig, LangConfig,
|
||||
normalizeSubtasks, ProblemConfigFile, readSubtasksFromFiles, readYamlCases,
|
||||
convertIniConfig, LangConfig, normalizeSubtasks, ProblemConfigFile, readSubtasksFromFiles,
|
||||
} from '@hydrooj/common';
|
||||
import { readYamlCases } from '@hydrooj/common/cases';
|
||||
import {
|
||||
changeErrorType, fs, yaml,
|
||||
} from '@hydrooj/utils';
|
||||
|
||||
@@ -3,8 +3,8 @@ import path from 'path';
|
||||
import PQueue from 'p-queue';
|
||||
import superagent from 'superagent';
|
||||
import WebSocket from 'ws';
|
||||
import type { LangConfig } from '@hydrooj/common';
|
||||
import { fs, pipeRequest } from '@hydrooj/utils';
|
||||
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
||||
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
|
||||
import type { JudgeResultBody } from 'hydrooj';
|
||||
import { getConfig } from '../config';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import path from 'path';
|
||||
import { parse } from 'shell-quote';
|
||||
import { CompilableSource } from '@hydrooj/common';
|
||||
import { fs } from '@hydrooj/utils';
|
||||
import { FormatError } from './error';
|
||||
|
||||
@@ -40,7 +41,8 @@ function restrictFile(p: string) {
|
||||
}
|
||||
|
||||
export function ensureFile(folder: string) {
|
||||
return (file: string, message: string) => {
|
||||
return (src: CompilableSource, message: string) => {
|
||||
const file = typeof src === 'string' ? src : src?.file;
|
||||
if (file === '/dev/null') return file;
|
||||
// Historical issue
|
||||
if (file.includes('/')) {
|
||||
|
||||
Reference in new issue
Block a user