tangled
alpha
login
or
join now
eldridge.cam
/
advent-of-code
2
fork
atom
Advent of Code solutions
2
fork
atom
overview
issues
pulls
pipelines
breaking run from compile steps
eldridge.cam
1 year ago
2ca38bc0
42569f84
+33
-22
1 changed file
expand all
collapse all
unified
split
Justfile
+33
-22
Justfile
···
9
9
default: p1 p2
10
10
11
11
[no-cd]
12
12
-
p1 input="input": (do "p1" input)
12
12
+
p1 input="input": (compile "p1") && (run "p1" input)
13
13
+
14
14
+
[no-cd]
15
15
+
p2 input="input": (compile "p2") && (run "p2" input)
13
16
14
17
[no-cd]
15
15
-
p2 input="input": (do "p2" input)
18
18
+
compile part:
19
19
+
#!/usr/bin/env fish
20
20
+
if test -f {{part}}.erl
21
21
+
erl -compile {{part}}.erl
22
22
+
else if test -f {{part}}.swift
23
23
+
swiftc {{part}}.swift > /dev/null
24
24
+
else if test -f {{part}}.rs
25
25
+
rustc {{part}}.rs > /dev/null
26
26
+
else if test -f {{part}}.c
27
27
+
gcc {{part}}.c -o {{part}} > /dev/null
28
28
+
else if test -f {{part}}.cpp
29
29
+
g++ -std=c++2c {{part}}.cpp -o {{part}} > /dev/null
30
30
+
else if test -f {{part}}.hs
31
31
+
ghc {{part}} -O -outputdir.{{part}} > /dev/null
32
32
+
else if ls | rg "\.cabal\$" -q
33
33
+
cabal build {{part}} > /dev/null
34
34
+
else if test -f {{part}}.erl
35
35
+
erl -compile "$fn"
36
36
+
else if test -d {{part}} -a -f {{part}}/gleam.toml
37
37
+
pushd {{part}}
38
38
+
gleam build
39
39
+
end
16
40
17
41
[no-cd]
18
18
-
do part input:
42
42
+
run part input="input":
19
43
#!/usr/bin/env fish
44
44
+
if test -x {{part}}
45
45
+
time ./{{part}} < {{input}}
46
46
+
exit 0
47
47
+
end
20
48
set fn (fd -d 1 -t f {{part}})
21
49
if test -n "$fn" -a -x "$fn"
22
50
time "./$fn" < {{input}}
···
36
64
pushd {{part}}
37
65
time gleam run "$fn" < ../{{input}}
38
66
else if test -f {{part}}.erl
39
39
-
erl -compile "$fn"
40
40
-
and time erl -noshell -s {{part}} main -s init stop < {{input}}
41
41
-
else if test -f {{part}}.swift
42
42
-
swiftc "$fn" > /dev/null
43
43
-
and time ./{{part}} < {{input}}
44
44
-
else if test -f {{part}}.rs
45
45
-
rustc "$fn" > /dev/null
46
46
-
and time ./{{part}} < {{input}}
47
47
-
else if test -f {{part}}.c
48
48
-
gcc "$fn" -o {{part}} > /dev/null
49
49
-
and time ./{{part}} < {{input}}
50
50
-
else if test -f {{part}}.cpp
51
51
-
g++ -std=c++2c "$fn" -o {{part}} > /dev/null
52
52
-
and time ./{{part}} < {{input}}
53
53
-
else if test -f {{part}}.hs
54
54
-
ghc {{part}} -O -outputdir.{{part}} > /dev/null
55
55
-
and time ./{{part}} < {{input}}
67
67
+
time erl -noshell -s {{part}} main -s init stop < {{input}}
56
68
else if ls | rg "\.cabal\$" -q
57
57
-
cabal build {{part}} > /dev/null
58
58
-
and time cabal run {{part}} < {{input}}
69
69
+
time cabal run {{part}} < {{input}}
59
70
else
60
71
echo "Current directory does not contain known solution configuration"
61
72
exit 1