Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/archtest/baseline/no-direct-exec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Each line is <file>:<line> of a known existing violation.
# Regenerate: ARCHTEST_UPDATE_BASELINE=1 go test ./internal/archtest/...
internal/auth/login.go:191
internal/brew/brew_install.go:337
internal/brew/brew_install.go:328
internal/cli/snapshot.go:21
internal/diff/compare.go:247
internal/diff/compare.go:253
Expand Down
21 changes: 6 additions & 15 deletions internal/brew/brew_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,11 @@ func InstallWithProgress(cliPkgs, caskPkgs []string, dryRun bool) (installedForm
return installedFormulae, installedCasks, nil
}

// installCasksWithProgress installs cask packages one by one, letting brew's
// own output (download progress, etc.) scroll through. Returns successful
// installs and failed jobs.
// installCasksWithProgress installs cask packages one by one with brew output
// suppressed. Returns successful installs and failed jobs.
func installCasksWithProgress(pkgs []string, progress *ui.StickyProgress) (installed []string, failed []failedJob) {
for _, pkg := range pkgs {
progress.SetCurrent(pkg)
progress.PrintLine(" Installing %s...", pkg)

start := time.Now()
errMsg := installCaskWithProgress(pkg)
Expand Down Expand Up @@ -313,18 +311,11 @@ func runSerialInstallWithProgress(pkgs []string, progress *ui.StickyProgress) []
}

func installCaskWithProgress(pkg string) string {
cmd := brewInstallCmd("install", "--cask", pkg)
tty, opened := system.OpenTTY()
if opened {
defer tty.Close() //nolint:errcheck // best-effort TTY cleanup
}
cmd.Stdin = tty
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return "install failed"
output, err := brewCombinedOutputWithTTY("install", "--cask", pkg)
if err == nil {
return ""
}
return ""
return parseBrewError(output)
}

// Runner-exempt: this helper sets HOMEBREW_NO_AUTO_UPDATE=1 and returns a raw
Expand Down
Loading