Skip to content

Commit

Permalink
Merge pull request #2220 from kubefirst/fix-stty-1
Browse files Browse the repository at this point in the history
fix : added bubbletea quit method instead of os exit
  • Loading branch information
jokestax authored Jul 3, 2024
2 parents 55e58cf + 7f36f03 commit 20b14fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cmd/k3d/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/kubefirst/kubefirst/internal/catalog"
"github.com/kubefirst/kubefirst/internal/gitShim"
"github.com/kubefirst/kubefirst/internal/segment"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/kubefirst/kubefirst/internal/utilities"
"github.com/kubefirst/metrics-client/pkg/telemetry"
"github.com/kubefirst/runtime/configs"
Expand Down Expand Up @@ -1407,7 +1408,7 @@ func runK3d(cmd *cobra.Command, args []string) error {
reports.LocalHandoffScreenV2(viper.GetString("components.argocd.password"), clusterNameFlag, gitDestDescriptor, cGitOwner, config, ciFlag)

if ciFlag {
os.Exit(0)
progress.Progress.Quit()
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ package cmd

import (
"fmt"
"os"

"github.com/kubefirst/kubefirst/internal/provisionLogs"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/nxadm/tail"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -28,7 +28,7 @@ var logsCmd = &cobra.Command{
t, err := tail.TailFile(viper.GetString("k1-paths.log-file"), tail.Config{Follow: true, ReOpen: true})
if err != nil {
fmt.Printf("Error tailing log file: %v\n", err)
os.Exit(1)
progress.Progress.Quit()
}

for line := range t.Lines {
Expand Down
3 changes: 1 addition & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package cmd

import (
"fmt"
"os"

"github.com/kubefirst/kubefirst/cmd/aws"
"github.com/kubefirst/kubefirst/cmd/civo"
Expand Down Expand Up @@ -51,7 +50,7 @@ func Execute() {
err := rootCmd.Execute()
if err != nil {
fmt.Printf("\nIf a detailed error message was available, please make the necessary corrections before retrying.\nYou can re-run the last command to try the operation again.\n\n")
os.Exit(1)
progress.Progress.Quit()
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/k3d/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"io"
"os"
"strings"

"github.com/kubefirst/kubefirst/internal/progress"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
Expand Down Expand Up @@ -125,7 +125,7 @@ func MongoDestinationChooser(inCluster bool) string {
model, err := tea.NewProgram(m).Run()
if err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
progress.Progress.Quit()
}

var result string
Expand Down

0 comments on commit 20b14fc

Please sign in to comment.