# Shamelessly nabbed from https://github.com/rakudo/rakudo/blob/master/src/core.c/Proc.pm6#L261-L265
sub myqx ($cmd, :$cwd = $*CWD, :$env) {
my $proc := Proc.new(:out);
$proc.shell($cmd, :$cwd, :$env);
(
$proc.out.slurp(:close) // Failure.new("Unable to read from '$cmd'"),
$proc.exitcode
)
}
Created
September 16, 2021 15:14
-
-
Save Xliff/b9d290cc5262dae05c0738111434d7e9 to your computer and use it in GitHub Desktop.
A QX with an exitcode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment