Can I pass the source instead file path?

I’m using this command:
“zig build-exe -target wasm32-freestanding -rdynamic” to build WebAssembly. However, I don’t have the path to the Zig file, only the source code. Is it possible to pass the source via stdin or as a parameter in the CLI?

No, a zig file is required.

Why don’t you make a temporary file with the zig source code?

TMP_FILE="$(mktemp)"
TMP_ZIG="$TMP_FILE.zig"
cat - > "$TMP_ZIG"
zig build-exe "$TMP_ZIG" ...
rm "$TMP_ZIG"
mv "$TMP_FILE" ./exe
1 Like

I can, I’m just looking at my options