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 gnutar
gzip gzip
gnugrep gnugrep
rename
util-linux util-linux
]; ];

View File

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

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 = ''
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 ${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig
''; '';