add perl-rename to container and update related runtime scripts

This commit is contained in:
Dan Vargas 2022-02-04 09:34:01 -07:00
parent 35cd527c69
commit 9cbec53580
3 changed files with 5 additions and 4 deletions

View File

@ -40,6 +40,7 @@ with pkgs; rec {
gnutar
gzip
gnugrep
rename
util-linux
];

View File

@ -15,11 +15,11 @@ in piston.mkRuntime {
export TMPDIR="$PWD"
# modify file extension
mv "$1" "$1.v"
filename="$1.v"
filename="$1"
rename 's/$/.v/' "$filename"
shift
${pkg}/bin/v run "$filename" "$@"
${pkg}/bin/v run "$filename.v" "$@"
'';
tests = [

View File

@ -8,7 +8,7 @@ in piston.mkRuntime {
# Add .zig extension for compile script and optimize compiler for small programs
compile = ''
for f; do mv "$f" "$f.zig"; done
rename 's/$/.zig/' "$@"
${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig
'';