@@ -3,6 +3,7 @@ import { existsSync } from "https://deno.land/std@0.224.0/fs/exists.ts";
3
3
import { getDayTemplate , getTestFileTemplate } from "./templates.ts" ;
4
4
import { getBorderCharacters , table } from "table" ;
5
5
import chalk from "chalk" ;
6
+ // import { writeAllSync } from "jsr:@std/io/write-all";
6
7
7
8
const logTable = ( content : unknown [ ] [ ] ) => {
8
9
console . log (
@@ -51,7 +52,9 @@ const argv = await yargs(Deno.args)
51
52
52
53
if ( ! Deno . env . get ( "AOC_SESSION_COOKIE" ) ) {
53
54
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
+ )
55
58
) ;
56
59
Deno . exit ( 1 ) ;
57
60
}
@@ -71,6 +74,11 @@ logTable([
71
74
[ "Fetching puzzle input from" , urlInput ] ,
72
75
] ) ;
73
76
77
+ // Terminal escape sequences
78
+ // const ESC = "\x1b[";
79
+
80
+ // writeAllSync(Deno.stdout, new TextEncoder().encode("Fetching!"));
81
+
74
82
Promise . all ( [
75
83
fetch ( urlSite , {
76
84
headers : {
@@ -101,6 +109,8 @@ Promise.all([
101
109
( exampleInput || "" ) . trim ( )
102
110
) ;
103
111
112
+ // writeAllSync(Deno.stdout, new TextEncoder().encode(ESC + "2K\r"));
113
+
104
114
logTable ( [
105
115
[ "Target directory" , targetDir ] ,
106
116
[ "For puzzle name" , formattedChallengeTitle ] ,
0 commit comments