diff options
author | Federico Igne <undyamon@disroot.org> | 2023-12-10 11:24:18 +0100 |
---|---|---|
committer | Federico Igne <undyamon@disroot.org> | 2023-12-10 11:24:18 +0100 |
commit | ba6089f4eefcbd6c482d2f774b8ce016bd0a4441 (patch) | |
tree | fe1c9e260a7c336db9ccdd72e14b520d196a7443 | |
parent | 537d4dd6f26757ff0bfa8627dc5ecb1ecb43705f (diff) | |
download | aoc-ba6089f4eefcbd6c482d2f774b8ce016bd0a4441.tar.gz aoc-ba6089f4eefcbd6c482d2f774b8ce016bd0a4441.zip |
fix(flake): multiline curl command
-rw-r--r-- | 2023/flake.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/2023/flake.nix b/2023/flake.nix index 654f196..7a8ee2b 100644 --- a/2023/flake.nix +++ b/2023/flake.nix | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | devshell = { | 22 | devshell = { |
23 | motd = '' | 23 | motd = '' |
24 | {bold}{3}🎄 Advent of Code ${year} 🎄{reset} | 24 | {bold}{3}🎄 Advent of Code ${builtins.toString year} 🎄{reset} |
25 | $(for CMD in g++ make gdb clangd ; do | 25 | $(for CMD in g++ make gdb clangd ; do |
26 | "$CMD" --version | head -n1 | 26 | "$CMD" --version | head -n1 |
27 | done) | 27 | done) |
@@ -48,13 +48,14 @@ | |||
48 | name = "start"; | 48 | name = "start"; |
49 | help = "Deploy directory structure for day $1"; | 49 | help = "Deploy directory structure for day $1"; |
50 | command = '' | 50 | command = '' |
51 | BASE="$(printf %02d $1)" | 51 | DAY="$1" |
52 | BASE="$(printf %02d $DAY)" | ||
52 | [ -d "$BASE" ] && echo "Existing directory '$BASE'" && exit 1 | 53 | [ -d "$BASE" ] && echo "Existing directory '$BASE'" && exit 1 |
53 | mkdir -p "$BASE" && cd $_ | 54 | mkdir -p "$BASE" && cd $_ |
54 | mkdir -p src resources | 55 | mkdir -p src resources |
55 | 56 | ||
56 | ${pkgs.curl}/bin/curl "https://adventofcode.com/${year}/day/$1/input" \ | 57 | ${pkgs.curl}/bin/curl "https://adventofcode.com/${builtins.toString year}/day/$DAY/input" \ |
57 | --cookie "session=$(cat ../../.secret/session.txt)" --silent | 58 | --cookie "session=$(< ../../.secret/session.txt)" --silent \ |
58 | --output-dir resources --output input.txt | 59 | --output-dir resources --output input.txt |
59 | 60 | ||
60 | cat << EOF >> src/part1.cpp | 61 | cat << EOF >> src/part1.cpp |