Skip to content

Commit

Permalink
dnt: use Deno.Command instead of Deno.run
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Mar 12, 2024
1 parent b92d31a commit 995ee52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts";
await emptyDir("./npm");

async function get_latest_version() {
const p = Deno.run({
cmd: ["git", "describe", "--tags", "--abbrev=0"],
stdout: "piped",
const p = new Deno.Command("git", {
args: ["describe", "--tags", "--abbrev=0"],
});

const decoder = new TextDecoder("utf-8");

const latest = await p
.output()
.then((result) => decoder.decode(result))
.then((result) => {
if (result.code !== 0) throw new Error("Couldn't get latest tag");
return decoder.decode(result.stdout);
})
// remove \n from end of string
.then((result) => result.slice(0, -1));

Expand Down

0 comments on commit 995ee52

Please sign in to comment.