Skip to content

Commit 446d529

Browse files
committed
Fix download with input target
1 parent 13d8727 commit 446d529

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

2024/1/Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
input:
2+
http "https://adventofcode.com/2024/day/1/input" "Cookie:session=${AOC_SESSION};" >input
3+
14
main1:
25
go build -o main1 main1.go
36

@@ -6,11 +9,11 @@ main2:
69

710
.PHONY: run1 run2 clean
811

9-
run1: main1
12+
run1: main1 input
1013
./main1 <input
1114

12-
run2: main2
15+
run2: main2 input
1316
./main2 <input
1417

1518
clean:
16-
rm -f main1 main2
19+
rm -f main1 main2 input

2024/2/Makefile

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
input:
2+
http "https://adventofcode.com/2024/day/2/input" "Cookie:session=${AOC_SESSION};" >input
3+
14
main1:
25
go build -o main1 main1.go common.go
36

@@ -6,12 +9,11 @@ main2:
69

710
.PHONY: run1 run2 clean
811

9-
run1: main1
12+
run1: main1 input
1013
./main1 <input
1114

12-
run2: main2
15+
run2: main2 input
1316
./main2 <input
1417

1518
clean:
16-
rm -f main1 main2
17-
19+
rm -f main1 main2 input

2024/3/Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
input:
2+
http "https://adventofcode.com/2024/day/3/input" "Cookie:session=${AOC_SESSION};" >input
3+
14
main1:
25
go build -o main1 main1.go
36

@@ -6,11 +9,11 @@ main2:
69

710
.PHONY: run1 run2 clean
811

9-
run1: main1
12+
run1: main1 input
1013
./main1 <input
1114

12-
run2: main2
15+
run2: main2 input
1316
./main2 <input
1417

1518
clean:
16-
rm -f main1 main2
19+
rm -f main1 main2 input

2024/4/Makefile

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
input:
2+
http "https://adventofcode.com/2024/day/4/input" "Cookie:session=${AOC_SESSION};" >input
3+
14
main1:
25
go build -o main1 main1.go common.go
36

@@ -6,12 +9,11 @@ main2:
69

710
.PHONY: run1 run2 clean
811

9-
run1: main1
12+
run1: main1 input
1013
./main1 <input
1114

12-
run2: main2
15+
run2: main2 input
1316
./main2 <input
1417

1518
clean:
16-
rm -f main1 main2
17-
19+
rm -f main1 main2 input

download.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if [ ! -f main1.go ]; then cp ../../go.template main1.go; fi
1111
if [ ! -f main2.go ]; then cp ../../go.template main2.go; fi
1212

1313
if [ ! -f Makefile ]; then cat >Makefile <<EOF
14-
download:
15-
http "https://adventofcode.com/$YEAR/day/$DAY/input" "Cookie:session=$AOC_SESSION;" >input
14+
input:
15+
http "https://adventofcode.com/$YEAR/day/$DAY/input" "Cookie:session=\${AOC_SESSION};" >input
1616
1717
main1:
1818
go build -o main1 main1.go
@@ -22,10 +22,10 @@ main2:
2222
2323
.PHONY: run1 run2 clean
2424
25-
run1: main1
25+
run1: main1 input
2626
./main1 <input
2727
28-
run2: main2
28+
run2: main2 input
2929
./main2 <input
3030
3131
clean:

0 commit comments

Comments
 (0)