aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorj-james2022-12-01 03:01:41 +0000
committerj-james2022-12-01 03:01:41 +0000
commit5bb17e9fcf87a976c69dab9e6a73a42745b3d4ce (patch)
tree138bfc44e692d4c8890af11ec2f5816c2b461f27
parent1ec309b88e176909dc3d72ecb715d6e2d68c2f3d (diff)
Move scripts to a util folder
-rwxr-xr-x2022/run5
-rwxr-xr-x2022/vars4
-rwxr-xr-x2022/watch7
-rwxr-xr-xutil/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-xutil/one (renamed from 2022/one)0
-rwxr-xr-xutil/run5
-rwxr-xr-xutil/two (renamed from 2022/two)0
-rwxr-xr-xutil/watch7
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
diff --git a/2022/get b/util/get
index b1eff41..423dfca 100755
--- a/2022/get
+++ b/util/get
@@ -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/2022/one b/util/one
index 6b7db35..6b7db35 100755
--- a/2022/one
+++ b/util/one
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/2022/two b/util/two
index 8dd0080..8dd0080 100755
--- a/2022/two
+++ b/util/two
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