Skip to content

Commit

Permalink
Merge pull request #7 from vnma0/fix-1
Browse files Browse the repository at this point in the history
Fix unusual bug
  • Loading branch information
dungwinux authored Mar 4, 2019
2 parents 59fb3e5 + 49f08b0 commit fb3962c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function submitToThemis(code, id) {
const newName = `[${id}][${base}]${ext}`;
const dest = join(submitFolder, newName);

copyFile(code.path, dest, (err) => {
return copyFile(code.path, dest, (err) => {
if (err) throw err;
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/routes/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const express = require("express");
const { join } = require("path");
const { readdirSync } = require("fs");
const { readdirSync, mkdirSync, existsSync } = require("fs");

const { submitFolder, cwd } = require("../config/folder");
const { parseLog, isFile } = require("../util/parser");
Expand All @@ -20,6 +20,7 @@ router.get("/", (req, res) => {
// TOOO: Seperate session to make the log private
// Folder contain log
const logFolder = join(cwd, submitFolder, "Logs");
if (!existsSync(logFolder)) mkdirSync(logFolder);

const fileList = readdirSync(logFolder)
.map((file) => join(logFolder, file)) // Convert into fullpath
Expand Down

0 comments on commit fb3962c

Please sign in to comment.