zig does not read files?

This reverts commit d69c3ceb73.
This commit is contained in:
Felix Van der Jeugt 2021-12-02 10:25:19 +01:00
parent d69c3ceb73
commit 1f013dc0c3
No known key found for this signature in database
GPG Key ID: 58B209295023754D
4 changed files with 6 additions and 19 deletions

View File

@ -1,4 +0,0 @@
root = true
[*.zig]
indent_style = space

View File

@ -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"});
}

3
clean
View File

@ -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"

12
prepare
View File

@ -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