mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix old format import
This commit is contained in:
1 parent
ddc320283b
commit
9aab641417
2 files changed
+2
-1
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.9.5",
|
"version": "3.9.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ function findOverrideContent(dir: string) {
|
|||||||
if (files.includes('problem.md')) return fs.readFileSync(path.join(dir, 'problem.md'), 'utf8');
|
if (files.includes('problem.md')) return fs.readFileSync(path.join(dir, 'problem.md'), 'utf8');
|
||||||
const languages = {};
|
const languages = {};
|
||||||
files = files.filter((i) => /^problem_[a-zA-Z_]+\.md$/.test(i));
|
files = files.filter((i) => /^problem_[a-zA-Z_]+\.md$/.test(i));
|
||||||
|
if (!files.length) return null;
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const lang = file.slice(8, -3);
|
const lang = file.slice(8, -3);
|
||||||
languages[lang] = fs.readFileSync(path.join(dir, file), 'utf8');
|
languages[lang] = fs.readFileSync(path.join(dir, file), 'utf8');
|
||||||
|
|||||||
Reference in new issue
Block a user