Skip to content

Commit a58ae1a

Browse files
committed
chore(_tools): use Deno.Command instread of Deno.run
1 parent 96eaa5d commit a58ae1a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

_tools/publish_npm.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ if (import.meta.main) {
1616
const tag = isPrerelease?.[0] ?? "latest";
1717

1818
const pkg = makeOptions(version);
19-
const result = await Deno.run({
20-
cmd: ["npm", "publish", pkg.outDir, "--tag", String(tag)],
21-
stdout: "piped",
22-
})
23-
.output();
19+
const command = new Deno.Command("npm", {
20+
args: ["publish", pkg.outDir, "--tag", String(tag)],
21+
});
22+
const result = await command.output();
2423

25-
console.log(new TextDecoder().decode(result));
24+
if (!result.success) {
25+
console.error(new TextDecoder().decode(result.stderr));
26+
}
2627
}

deno.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"]
88
},
99
"lint": {
10-
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"],
11-
"rules": {
12-
"exclude": ["no-deprecated-deno-api"]
13-
}
10+
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"]
1411
},
1512
"test": {
1613
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"]

0 commit comments

Comments
 (0)