core: 支持题目导出

This commit is contained in:
undefined committed 2020-11-07 23:47:35 +08:00
1 parent a5004a7c1b
commit ee0f5deedc
11 files changed
+87 -33

No files matched your search

+2 -2
View File
@@ -2,8 +2,8 @@ import Zip from 'adm-zip';
import { safeLoad } from 'js-yaml';
import { LocalProblemConfig } from '../interface';
export async function readConfig(filePath: string) {
const data = new Zip(filePath);
export async function readConfig(file: string | Buffer) {
const data = new Zip(file);
const entries = data.getEntries();
for (const entry of entries) {
if (entry.name.toLowerCase() === 'config.yaml') {