mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
migrate: fix hustoj import
This commit is contained in:
1 parent
add93f5783
commit
101fcaa1b5
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/migrate",
|
"name": "@hydrooj/migrate",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "git@github.com:hydro-dev/Hydro.git",
|
"repository": "git@github.com:hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const langMap = {
|
|||||||
16: 'js',
|
16: 'js',
|
||||||
17: 'go',
|
17: 'go',
|
||||||
};
|
};
|
||||||
const nameMap = {
|
const nameMap: Record<string, string> = {
|
||||||
'sample.in': 'sample0.in',
|
'sample.in': 'sample0.in',
|
||||||
'sample.out': 'sample0.out',
|
'sample.out': 'sample0.out',
|
||||||
'test.in': 'test0.in',
|
'test.in': 'test0.in',
|
||||||
@@ -291,7 +291,7 @@ export async function run({
|
|||||||
report({ message: `Syncing testdata for ${file.name}` });
|
report({ message: `Syncing testdata for ${file.name}` });
|
||||||
for (const data of datas) {
|
for (const data of datas) {
|
||||||
if (data.isDirectory()) continue;
|
if (data.isDirectory()) continue;
|
||||||
const filename = nameMap[data.name] || data;
|
const filename = nameMap[data.name] || data.name;
|
||||||
await ProblemModel.addTestdata(domainId, pdoc.docId, filename, `${dataDir}/${file.name}/${data.name}`);
|
await ProblemModel.addTestdata(domainId, pdoc.docId, filename, `${dataDir}/${file.name}/${data.name}`);
|
||||||
}
|
}
|
||||||
await ProblemModel.addTestdata(domainId, pdoc.docId, 'config.yaml', Buffer.from(pdoc.config as string));
|
await ProblemModel.addTestdata(domainId, pdoc.docId, 'config.yaml', Buffer.from(pdoc.config as string));
|
||||||
|
|||||||
Reference in new issue
Block a user