Skip to content

Commit

Permalink
finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrareddyp committed May 1, 2024
1 parent 333694a commit 399c016
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/pluginmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"

"github.com/Masterminds/semver"
Expand Down Expand Up @@ -64,6 +65,11 @@ var spinner component.OutputWriterSpinner
func init() {
// Initialize global spinner
spinner = component.NewOutputWriterSpinner(component.WithOutputStream(os.Stderr))
runtime.SetFinalizer(spinner, func(s component.OutputWriterSpinner) {
if s != nil {
s.StopSpinner()
}
})
}

func StopSpinner() {
Expand Down

0 comments on commit 399c016

Please sign in to comment.