Skip to content

Commit 85db7f9

Browse files
committedDec 6, 2024
changes
1 parent 3bc2718 commit 85db7f9

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
 

‎deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tasks": {
3-
"sd": "deno run scaffold",
3+
"sd": "deno run --env-file scaffold",
44
"test:CICD": "deno test -A --filter '/[Ee]xample/'",
55
"scaffold": "deno run --allow-read --allow-env --allow-net --allow-write ./scripts/day-builder.ts scaffold"
66
},

‎deno.lock

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/day-builder.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { existsSync } from "https://deno.land/std@0.224.0/fs/exists.ts";
33
import { getDayTemplate, getTestFileTemplate } from "./templates.ts";
44
import { getBorderCharacters, table } from "table";
55
import chalk from "chalk";
6+
// import { writeAllSync } from "jsr:@std/io/write-all";
67

78
const logTable = (content: unknown[][]) => {
89
console.log(
@@ -51,7 +52,9 @@ const argv = await yargs(Deno.args)
5152

5253
if (!Deno.env.get("AOC_SESSION_COOKIE")) {
5354
console.error(
54-
"AOC_SESSION_COOKIE environment variable is not set, please set it to your AOC session cookie. This is required to download the puzzle input."
55+
chalk.red(
56+
"❌ AOC_SESSION_COOKIE environment variable is not set, please set it to your AOC session cookie. This is required to download the puzzle input."
57+
)
5558
);
5659
Deno.exit(1);
5760
}
@@ -71,6 +74,11 @@ logTable([
7174
["Fetching puzzle input from", urlInput],
7275
]);
7376

77+
// Terminal escape sequences
78+
// const ESC = "\x1b[";
79+
80+
// writeAllSync(Deno.stdout, new TextEncoder().encode("Fetching!"));
81+
7482
Promise.all([
7583
fetch(urlSite, {
7684
headers: {
@@ -101,6 +109,8 @@ Promise.all([
101109
(exampleInput || "").trim()
102110
);
103111

112+
// writeAllSync(Deno.stdout, new TextEncoder().encode(ESC + "2K\r"));
113+
104114
logTable([
105115
["Target directory", targetDir],
106116
["For puzzle name", formattedChallengeTitle],

0 commit comments

Comments
 (0)
Please sign in to comment.