gt down --all: also kill tmux server
This commit is contained in:
@@ -36,11 +36,13 @@ This is useful for:
|
||||
var (
|
||||
downQuiet bool
|
||||
downForce bool
|
||||
downAll bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
downCmd.Flags().BoolVarP(&downQuiet, "quiet", "q", false, "Only show errors")
|
||||
downCmd.Flags().BoolVarP(&downForce, "force", "f", false, "Force kill without graceful shutdown")
|
||||
downCmd.Flags().BoolVarP(&downAll, "all", "a", false, "Also kill the tmux server")
|
||||
rootCmd.AddCommand(downCmd)
|
||||
}
|
||||
|
||||
@@ -96,6 +98,16 @@ func runDown(cmd *cobra.Command, args []string) error {
|
||||
printDownStatus("Daemon", true, "not running")
|
||||
}
|
||||
|
||||
// 5. Kill tmux server if --all
|
||||
if downAll {
|
||||
if err := t.KillServer(); err != nil {
|
||||
printDownStatus("Tmux server", false, err.Error())
|
||||
allOK = false
|
||||
} else {
|
||||
printDownStatus("Tmux server", true, "killed")
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
if allOK {
|
||||
fmt.Printf("%s All services stopped\n", style.Bold.Render("✓"))
|
||||
|
||||
Reference in New Issue
Block a user