Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Exercise } from "./exercise.ts";
import { readFile } from "node:fs/promises";

interface RunResult {
ok: boolean;
Expand Down Expand Up @@ -26,7 +27,7 @@ const check = async (exercise: Exercise): Promise<RunResult> => {
};

const isDone = async (exercise: Exercise): Promise<boolean> => {
return !(await Deno.readTextFile(exercise.path)).includes("// I AM NOT DONE");
return !(await readFile(exercise.path, "utf-8")).includes("// I AM NOT DONE");
};

export { check, isDone };
3 changes: 2 additions & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Exercise } from "./exercise.ts";
import { Colors } from "./deps.ts";
import process from "node:process";

const congratsAndExit = () => {
console.log("🎉 Congrats! You have finished all the exercises!");
Deno.exit(0);
process.exit(0);
};

const nextInstuctions = () => {
Expand Down
Loading