From 1f013dc0c394c8cd209b2653b192c0ed2e47b3c0 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Thu, 2 Dec 2021 10:25:19 +0100 Subject: [PATCH] zig does not read files? This reverts commit d69c3ceb73febf66f365a9abf768fc97672ba390. --- .editorconfig | 4 ---- Day01/Part1.zig | 6 ------ clean | 3 ++- prepare | 12 ++++-------- 4 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 .editorconfig delete mode 100644 Day01/Part1.zig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index b18b4fb..0000000 --- a/.editorconfig +++ /dev/null @@ -1,4 +0,0 @@ -root = true - -[*.zig] -indent_style = space diff --git a/Day01/Part1.zig b/Day01/Part1.zig deleted file mode 100644 index 259e332..0000000 --- a/Day01/Part1.zig +++ /dev/null @@ -1,6 +0,0 @@ -const std = @import("std"); - -pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("Hello, {s}!\n", .{"world"}); -} diff --git a/clean b/clean index 7f20d2d..225afb3 100755 --- a/clean +++ b/clean @@ -4,4 +4,5 @@ part="$2" day="$(printf '%02d' "$day")" -rm -r -f run "Day${day}/Part${part}.hi" "Day${1}/Part${part}.o" "Day${day}/zig-cache" +rm -f ./run ./luac.out +rm -f "Day${1}/Part${2}.hi" "Day${1}/Part${2}.o" diff --git a/prepare b/prepare index 1a570eb..5ae7ae1 100755 --- a/prepare +++ b/prepare @@ -4,15 +4,11 @@ part="$2" day="$(printf '%02d' "$day")" -name="Day${day}/Part${part}" - -if zig -h > /dev/null && test -f "${name}.zig"; then - zig build-exe --name run "${name}.zig" -elif luac -v > /dev/null && test -f "${name}.lua"; then - luac -o luac.out "${name}.lua" +if test -f "Day${day}/Part${part}.lua"; then + luac -o luac.out "Day${day}/Part${part}.lua" printf '#!/bin/sh\nlua luac.out "$@"\n' > run chmod u+x run -elif stack > /dev/null && test -f "${name}.hs"; then +elif test -f "Day${day}/Part${part}.hs"; then #stack build - stack ghc -- -O3 "${name}.hs" -o run + stack ghc -- -O3 "Day${day}/Part${part}.hs" -o run fi