Skip to content

Commit

Permalink
Simplify internal QX sub
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lizmat committed Dec 8, 2023
1 parent ce46b15 commit e22987f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/Proc.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e22987f

Please sign in to comment.