From e22987f4cae5b26163a18c3e76e9fead37e601bf Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 8 Dec 2023 13:51:28 +0100 Subject: [PATCH] Simplify internal QX sub This is the workhorse behind qx/ /, but since this will never get called with the :cwd or :env arguments, handling them here seems unnecessary. So don't. This sub should probably become a class method of Proc, and codegenning adapted accordingly, as to avoid poisoning of the core setting. --- src/core.c/Proc.rakumod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.c/Proc.rakumod b/src/core.c/Proc.rakumod index 502930b76b7..50182af5e1a 100644 --- a/src/core.c/Proc.rakumod +++ b/src/core.c/Proc.rakumod @@ -242,9 +242,9 @@ multi sub shell($cmd, :$in = '-', :$out = '-', :$err = '-', $proc } -sub QX($cmd, :$cwd = $*CWD, :$env) is implementation-detail { +sub QX($cmd) is implementation-detail { my $proc := Proc.new(:out); - $proc.shell($cmd, :$cwd, :$env); + $proc.shell($cmd); $proc.out.slurp(:close) // "Unable to read from '$cmd'".Failure }