mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
judge.vj4: run dos2unix for input files
This commit is contained in:
1 parent
408be70ce5
commit
26206d36cc
2 files changed
+11
-2
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.4.11",
|
"version": "2.4.12",
|
||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -385,7 +385,16 @@ export default class VJ4 {
|
|||||||
else if (i.toLowerCase() === 'output') await fs.rename(`${folder}/${i}`, `${folder}/output`);
|
else if (i.toLowerCase() === 'output') await fs.rename(`${folder}/${i}`, `${folder}/output`);
|
||||||
}
|
}
|
||||||
files = await fs.readdir(`${folder}/input`);
|
files = await fs.readdir(`${folder}/input`);
|
||||||
for (const i of files) await fs.rename(`${folder}/input/${i}`, `${folder}/input/${i.toLowerCase()}`);
|
for (const i of files) {
|
||||||
|
if (fs.statSync(`${folder}/input/${i}`).size > 64 * 1024 * 1024) {
|
||||||
|
await fs.rename(`${folder}/input/${i}`, `${folder}/input/${i.toLowerCase()}`);
|
||||||
|
} else {
|
||||||
|
const buffer = await fs.readFile(`${folder}/input/${i}`);
|
||||||
|
const data = buffer.toString().replace(/\r/g, '');
|
||||||
|
await fs.unlink(`${folder}/input/${i}`);
|
||||||
|
await fs.writeFile(`${folder}/input/${i.toLowerCase()}`, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
files = await fs.readdir(`${folder}/output`);
|
files = await fs.readdir(`${folder}/output`);
|
||||||
for (const i of files) await fs.rename(`${folder}/output/${i}`, `${folder}/output/${i.toLowerCase()}`);
|
for (const i of files) await fs.rename(`${folder}/output/${i}`, `${folder}/output/${i.toLowerCase()}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user