diff options
author | j-james | 2022-12-01 03:01:41 +0000 |
---|---|---|
committer | j-james | 2022-12-01 03:01:41 +0000 |
commit | 5bb17e9fcf87a976c69dab9e6a73a42745b3d4ce (patch) | |
tree | 138bfc44e692d4c8890af11ec2f5816c2b461f27 | |
parent | 1ec309b88e176909dc3d72ecb715d6e2d68c2f3d (diff) |
Move scripts to a util folder
-rwxr-xr-x | 2022/run | 5 | ||||
-rwxr-xr-x | 2022/vars | 4 | ||||
-rwxr-xr-x | 2022/watch | 7 | ||||
-rwxr-xr-x | util/get (renamed from 2022/get) | 7 | ||||
-rw-r--r-- | util/main.nim (renamed from 2022/main.nim) | 0 | ||||
-rw-r--r-- | util/main.rs (renamed from 2022/main.rs) | 0 | ||||
-rwxr-xr-x | util/one (renamed from 2022/one) | 0 | ||||
-rwxr-xr-x | util/run | 5 | ||||
-rwxr-xr-x | util/two (renamed from 2022/two) | 0 | ||||
-rwxr-xr-x | util/watch | 7 |
10 files changed, 16 insertions, 19 deletions
diff --git a/2022/run b/2022/run deleted file mode 100755 index 45f80aa..0000000 --- a/2022/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -source "vars" - -nim c --warnings:off --hints:off -r "nim/day${DAY}/main.nim" "nim/day${DAY}/input.txt" diff --git a/2022/vars b/2022/vars deleted file mode 100755 index 31e8b53..0000000 --- a/2022/vars +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -DAY="01" -YEAR="2022" diff --git a/2022/watch b/2022/watch deleted file mode 100755 index 3792b58..0000000 --- a/2022/watch +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -source "vars" - -while inotifywait --quiet --event modify "~/watched_file" -do ./run -done @@ -4,13 +4,14 @@ source "vars" INPUT_URL="https://adventofcode.com/${YEAR}/day/$((10#${DAY}))/input" mkdir "nim/day${DAY}" -cp "main.nim" "nim/day${DAY}/main.nim" +mkdir "nim/day${DAY}/src" +cp "main.nim" "nim/day${DAY}/src/main.nim" curl $INPUT_URL --cookie "session=${TOKEN}" > "nim/day${DAY}/input.txt" cargo new "rust/day${DAY}" cp "main.rs" "rust/day${DAY}/src/main.rs" -cp "nim/day${DAY}/input.txt" "rust/day${DAY}/src/input.txt" +cp "nim/day${DAY}/input.txt" "rust/day${DAY}/input.txt" subl -a "nim/day${DAY}/input.txt" -subl -a "nim/day${DAY}/main.nim" +subl -a "nim/day${DAY}/src/main.nim" # chromium "https://adventofcode.com/${YEAR}/day/$((10#${DAY}))" diff --git a/2022/main.nim b/util/main.nim index 15ba6b9..15ba6b9 100644 --- a/2022/main.nim +++ b/util/main.nim diff --git a/2022/main.rs b/util/main.rs index 2cad662..2cad662 100644 --- a/2022/main.rs +++ b/util/main.rs diff --git a/util/run b/util/run new file mode 100755 index 0000000..3d068e1 --- /dev/null +++ b/util/run @@ -0,0 +1,5 @@ +#!/bin/bash + +source "vars" + +nim c --warnings:off --hints:off -r "nim/day${DAY}/src/main.nim" "nim/day${DAY}/input.txt" diff --git a/util/watch b/util/watch new file mode 100755 index 0000000..9c79c6e --- /dev/null +++ b/util/watch @@ -0,0 +1,7 @@ +#!/bin/bash + +source "vars" + +while inotifywait --quiet --event modify "nim/day${DAY}/src/main.nim" +do ./run +done |