-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (31 loc) · 898 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"github.com/ChrisWrenDev/advent-of-code/scripts"
)
func main() {
day, year, generateTemplate, getInput, getPrompt, checkCookie := scripts.ParseFlags()
dayDir := fmt.Sprintf("%d/day%02d", year, day)
if checkCookie {
hasCookie := scripts.CheckAocCookie()
if hasCookie {
fmt.Println("Add AOC Session Cookie to .session file")
} else {
fmt.Println("AOC Session Cookie found in .session file")
}
}
if getPrompt {
body := scripts.GetAocPrompt(day, year)
scripts.CreateAocFile(dayDir, "prompt.txt", body)
fmt.Printf("Prompt for %d Day %d saved.\n", year, day)
}
if getInput {
body := scripts.GetAocInput(day, year)
scripts.CreateAocFile(dayDir, "input.txt", body)
fmt.Printf("Input for %d Day %d saved.\n", year, day)
}
if generateTemplate {
scripts.GenerateAocTemplate(dayDir)
fmt.Println("Template created at: ", dayDir)
}
}