import * as Path from "@std/path"; export function execSync(...args: string[]) { const cmd = new Deno.Command(args[0], { args: args.slice(1), }); return cmd.outputSync(); } export function writeCar(path: string, cid: string) { execSync( "deno", "run", "-A", "ipfs-car", "pack", path, "--no-wrap", "--output", Path.join("cars", `${cid}.car`), ); } export function utf8String(bytes: Uint8Array) { return new TextDecoder().decode(bytes); }