[web] Abstract options type
This commit is contained in:
parent
7f2e4c815c
commit
9482a1f46b
@ -7,12 +7,14 @@ import { dirname } from 'path';
|
|||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import http from 'isomorphic-git/http/node';
|
import http from 'isomorphic-git/http/node';
|
||||||
|
|
||||||
async function addProblemsJava(opts: {
|
type OptsAddProblems = {
|
||||||
fs: memfs.IFs;
|
fs: memfs.IFs;
|
||||||
templateDir: string;
|
templateDir: string;
|
||||||
dir: string;
|
dir: string;
|
||||||
contest: { problems: { pascalName: string }[] };
|
contest: { problems: { pascalName: string }[] };
|
||||||
}) {
|
};
|
||||||
|
|
||||||
|
async function addProblemsJava(opts: OptsAddProblems) {
|
||||||
const template = hostFs
|
const template = hostFs
|
||||||
.readFileSync(join(opts.templateDir, 'java/problem/problem.java'))
|
.readFileSync(join(opts.templateDir, 'java/problem/problem.java'))
|
||||||
.toString();
|
.toString();
|
||||||
@ -27,12 +29,7 @@ async function addProblemsJava(opts: {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addProblemsCSharp(opts: {
|
async function addProblemsCSharp(opts: OptsAddProblems) {
|
||||||
fs: memfs.IFs;
|
|
||||||
templateDir: string;
|
|
||||||
dir: string;
|
|
||||||
contest: { problems: { pascalName: string }[] };
|
|
||||||
}) {
|
|
||||||
const project = hostFs
|
const project = hostFs
|
||||||
.readFileSync(join(opts.templateDir, 'csharp/problem/problem.csproj'))
|
.readFileSync(join(opts.templateDir, 'csharp/problem/problem.csproj'))
|
||||||
.toString();
|
.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user