Skip to content

Commit

Permalink
fix(dist): fix npm publish 2fac in release script
Browse files Browse the repository at this point in the history
When the relase script runs 'npm publish', publishing fails because
the command requires interactive 2-factor auth.

Make release.go forward stdin and stdout/stderr so that 'npm publish'
can run interactively.

This commit affects more commands, such as 'rsync', in case an ssh
auth prompt appears, or if the user just wants to see the output of
commands.
  • Loading branch information
strager committed Nov 3, 2023
1 parent 2b4ea2d commit 48c2557
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ func UpdateReleaseVersions(options UpdateReleaseVersionsOptions) ([]byte, error)

func RunCommandOrStop(name string, arg ...string) {
cmd := exec.Command(name, arg...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
commandString := CommandToShell(cmd.Args)
Stopf("failed to run command:\n$ %s\n%v", commandString, err)
Expand Down

0 comments on commit 48c2557

Please sign in to comment.