migrate: fix hustoj import

This commit is contained in:
undefined committed 2022-10-15 20:50:11 +08:00
1 parent add93f5783
commit 101fcaa1b5
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/migrate",
"version": "0.2.0",
"version": "0.2.1",
"main": "index.ts",
"repository": "git@github.com:hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>",
+2 -2
View File
@@ -42,7 +42,7 @@ const langMap = {
16: 'js',
17: 'go',
};
const nameMap = {
const nameMap: Record<string, string> = {
'sample.in': 'sample0.in',
'sample.out': 'sample0.out',
'test.in': 'test0.in',
@@ -291,7 +291,7 @@ export async function run({
report({ message: `Syncing testdata for ${file.name}` });
for (const data of datas) {
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, 'config.yaml', Buffer.from(pdoc.config as string));