fix zig extension rename

This commit is contained in:
Dan Vargas 2022-02-03 19:55:08 -07:00
parent e0c41e3dda
commit a857780f34
1 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ in piston.mkRuntime {
# Add .zig extension for compile script and optimize compiler for small programs # Add .zig extension for compile script and optimize compiler for small programs
compile = '' compile = ''
rename 's/$/\.zig/' "$@" for f; do mv "$f" "$f.zig"; done
${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig ${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig
''; '';
@ -22,10 +22,10 @@ in piston.mkRuntime {
# Run the following command to test the package: # Run the following command to test the package:
# $ ./piston test zig # $ ./piston test zig
tests = [ tests = [
# Standard output test # Standard output test with generic file extension
(piston.mkTest { (piston.mkTest {
files = { files = {
"test.zig" = '' "file0.code" = ''
const std = @import("std"); const std = @import("std");
pub fn main() !void { pub fn main() !void {
@ -37,7 +37,7 @@ in piston.mkRuntime {
args = []; args = [];
stdin = ""; stdin = "";
packages = []; packages = [];
main = "test.zig"; main = "file0.code";
}) })
]; ];
} }