import { $ } from "https://deno.land/x/denoexec@v1.1.5/lib/functional.ts";
$
emulates a sub shell, essentially it sets inheritStdio
to false
&
captureStdio
to true
and then returns the result of stdioCombined()
.
Example Usage:
const branch = await $(_`git rev-parse --abbrev-ref HEAD`);
Also accepts a string template literal directly:
const branch = await $`git rev-parse --abbrev-ref HEAD`;
Or an list of arguments:
const branch = await $("git", "rev-parse", "--abbrev-ref", "HEAD");