core: fix bugs (#435)

This commit is contained in:
panda authored and GitHub committed 2022-10-06 13:29:07 +08:00
1 parent f4b12ef004
commit 4c669e0194
3 files changed
+7 -9

No files matched your search

+3 -2
View File
@@ -51,8 +51,9 @@ class ProblemImportHydroHandler extends Handler {
});
try {
const problems = await fs.readdir(tmpdir, { withFileTypes: true });
for (const { name: i, isDirectory } of problems) {
if (!isDirectory()) continue;
for (const p of problems) {
const i = p.name;
if (!p.isDirectory()) continue;
const files = await fs.readdir(path.join(tmpdir, i));
if (!files.includes('problem.yaml')) continue;
const content = fs.readFileSync(path.join(tmpdir, i, 'problem.yaml'), 'utf-8');