Skip to content

Commit 4ab3e74

Browse files
committed
fix(stdout): fix the reference of stdout from execa
1 parent 1967d72 commit 4ab3e74

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/verify-auth.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { execa } from "execa";
22
import normalizeUrl from "normalize-url";
33
import AggregateError from "aggregate-error";
4-
import getError from "./get-error.js";
54
import getRegistry from "./get-registry.js";
6-
import setNpmrcAuth from "./set-npmrc-auth.js";
75

86
export default async function (npmrc, pkg, context) {
97
const {
@@ -18,7 +16,7 @@ export default async function (npmrc, pkg, context) {
1816

1917
if (normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY)) {
2018
// try {
21-
const publishDryRunResult = execa("npm", ["publish", "--dry-run", "--tag=semantic-release-auth-check"], {cwd, env, preferLocal: true});
19+
const publishDryRunResult = execa("npm", ["publish", "--dry-run", "--tag=semantic-release-auth-check"], {cwd, env, preferLocal: true, lines: true});
2220
// const whoamiResult = execa("npm", ["whoami", "--userconfig", npmrc, "--registry", registry], {
2321
// cwd,
2422
// env,
@@ -28,9 +26,9 @@ export default async function (npmrc, pkg, context) {
2826
// whoamiResult.stderr.pipe(stderr, { end: false });
2927
// await whoamiResult;
3028
publishDryRunResult.stdout.pipe(stdout, { end: false });
31-
publishDryRunResult.stderr.pipe(stderr, { end: false, lines: true });
32-
const {stdout} = await publishDryRunResult;
33-
stdout.forEach((line) => {
29+
publishDryRunResult.stderr.pipe(stderr, { end: false });
30+
const {stdout: execaStdout} = await publishDryRunResult;
31+
execaStdout.forEach((line) => {
3432
if (line.includes("warn This command requires you to be logged in to https://registry.npmjs.org/")) {
3533
throw new AggregateError([new Error('no auth context')]);
3634
}

0 commit comments

Comments
 (0)