mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2026-04-09 02:23:36 +00:00
remove scaffold.sh
add scaffold aoc template
This commit is contained in:
17
.scaffold/aoc/hooks/post_scaffold.sh
Normal file
17
.scaffold/aoc/hooks/post_scaffold.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "{{ .Project }}" || exit 1
|
||||
|
||||
go mod init github.com/onyx-and-iris/aoc{{ .Scaffold.year }}/"{{ .Project }}"
|
||||
go mod tidy
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
day=$(echo "{{ .Project }}" | sed 's/^day-0*//')
|
||||
|
||||
mkdir -p testdata
|
||||
curl "https://adventofcode.com/{{ .Scaffold.year }}/day/$day/input" -H "Cookie: session=$AOC_SESSION" > testdata/input.txt
|
||||
|
||||
|
||||
mkdir -p cmd/cli/testdata && ln testdata/input.txt cmd/cli/testdata/input.txt
|
||||
mkdir -p internal/one/testdata && ln testdata/input.txt internal/one/testdata/input.txt
|
||||
mkdir -p internal/two/testdata && ln testdata/input.txt internal/two/testdata/input.txt
|
||||
Reference in New Issue
Block a user