await $`deno eval ''`;
// error: the following required arguments were not provided:
// ...
test
#!/bin/sh
# ./test.sh: Output the number of arguments ($#) and the value of each argument
printf '$#: %d\n' $#
for i in "$@"; do
printf ' [%s]\n' "$i"
done
import $ from "https://deno.land/x/dax/mod.ts";
import $2 from "./mod.ts"; // this branch
Deno.env.set("X", "yyy zzzz");
console.log("master:");
await $`./test.sh`.printCommand();
await $`./test.sh A 'B' "C"`.printCommand();
await $`./test.sh A "" ""`.printCommand();
await $`./test.sh $X"$X"'$X'`.printCommand();
console.log("\n\nPR:");
await $2`./test.sh`.printCommand();
await $2`./test.sh A 'B' "C"`.printCommand();
await $2`./test.sh A '' ""`.printCommand();
await $2`./test.sh $X"$X"'$X'`.printCommand();
console.log("\n\nBash:");
await runBash(`./test.sh`);
await runBash(`./test.sh A 'B' "C"`);
await runBash(`./test.sh A '' ""`);
await runBash(`./test.sh $X"$X"'$X'`);
async function runBash(cmd: string) {
console.log(`> bash -c ${cmd}`);
await new Deno.Command("bash", {
args: ["-c", cmd],
stdout: "inherit",
}).spawn();
}
deno eval ''
should succeed and output nothing.test