Skip to content

Commit

Permalink
πŸŽ‰ begin
Browse files Browse the repository at this point in the history
  • Loading branch information
UltiRequiem authored Aug 3, 2022
0 parents commit 68375ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export async function isInstalled(program: string, args = ["--help"]) {
try {
await Deno.spawn(program, { args, stdout: "null", stderr: "null" });

return true;
} catch (error) {
if (error instanceof Deno.errors.NotFound) {
return false;
}

throw error;
}
}

0 comments on commit 68375ea

Please sign in to comment.