mirror of
https://github.com/turbot/steampipe.git
synced 2026-05-05 09:01:26 -04:00
Fixes issue where spinner message is not shown for FDW update. Closes #643
This commit is contained in:
@@ -41,10 +41,10 @@ func EnsureDBInstalled() {
|
||||
if fdwNeedsUpdate() {
|
||||
_, err := installFDW(false, spinner)
|
||||
if err != nil {
|
||||
display.StopSpinner(spinner)
|
||||
utils.FailOnError(err)
|
||||
}
|
||||
|
||||
spinner.Stop()
|
||||
fmt.Printf("%s was updated to %s. ", constants.Bold("steampipe-postgres-fdw"), constants.Bold(constants.FdwVersion))
|
||||
currentStatus, err := GetStatus()
|
||||
if err != nil || currentStatus != nil {
|
||||
@@ -55,6 +55,7 @@ func EnsureDBInstalled() {
|
||||
}
|
||||
|
||||
if needsInit() {
|
||||
spinner.Start()
|
||||
display.UpdateSpinnerMessage(spinner, "Cleanup any Steampipe processes...")
|
||||
killInstanceIfAny()
|
||||
if err := doInit(false, spinner); err != nil {
|
||||
|
||||
@@ -86,7 +86,7 @@ func ShowSpinner(msg string) *spinner.Spinner {
|
||||
|
||||
// StopSpinnerWithMessage stops a spinner instance and clears it, after writing `finalMsg`
|
||||
func StopSpinnerWithMessage(spinner *spinner.Spinner, finalMsg string) {
|
||||
if spinner != nil && spinner.Active() {
|
||||
if spinner != nil {
|
||||
spinner.FinalMSG = finalMsg
|
||||
spinner.Stop()
|
||||
}
|
||||
@@ -94,14 +94,14 @@ func StopSpinnerWithMessage(spinner *spinner.Spinner, finalMsg string) {
|
||||
|
||||
// StopSpinner stops a spinner instance and clears it
|
||||
func StopSpinner(spinner *spinner.Spinner) {
|
||||
if spinner != nil && spinner.Active() {
|
||||
if spinner != nil {
|
||||
spinner.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateSpinnerMessage updates the message of the given spinner
|
||||
func UpdateSpinnerMessage(spinner *spinner.Spinner, newMessage string) {
|
||||
if spinner != nil && spinner.Active() {
|
||||
if spinner != nil {
|
||||
newMessage = truncateSpinnerMessageToScreen(newMessage)
|
||||
spinner.Suffix = fmt.Sprintf(" %s", newMessage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user