Skip to content

Commit

Permalink
better findFile
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadtdyy committed Nov 19, 2024
1 parent a7cae85 commit 525a9eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/onsite-toolkit/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-len */
import moment from 'moment';
import {
AdmZip, avatar, ContestModel, ContestNotEndedError, Context, db, ForbiddenError,
AdmZip, avatar, ContestModel, ContestNotEndedError, Context, db, findFileSync, ForbiddenError,
fs,
ObjectId, parseTimeMS, PERM, ProblemConfig, ProblemModel, STATUS, STATUS_SHORT_TEXTS, STATUS_TEXTS, Time, UserModel,
} from 'hydrooj';
Expand Down Expand Up @@ -249,7 +249,7 @@ export function apply(ctx: Context) {
];
const zip = new AdmZip();
zip.addFile('event-feed.ndjson', Buffer.from(eventfeed.concat(submissions).concat(endState).map((i) => JSON.stringify(i)).join('\n')));
zip.addFile('contest/logo.png', Buffer.from(fs.readFileSync(`${__dirname}/public/logo.png`)));
zip.addFile('contest/logo.png', fs.readFileSync(findFileSync('@hydrooj/onsite-toolkit/public/logo.png')));
for (const i of ['teams', 'organizations']) {
zip.addFile(`${i}/`, Buffer.alloc(0));
}
Expand Down

0 comments on commit 525a9eb

Please sign in to comment.