Skip to content

Commit

Permalink
fix for Installation should stop when exiting the launcher #509
Browse files Browse the repository at this point in the history
  • Loading branch information
Prototype4988 committed Oct 6, 2024
1 parent 0244b72 commit dfab184
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wren-launcher/commands/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"os/signal"
"path"
"strings"
"time"
Expand Down Expand Up @@ -134,6 +135,18 @@ func Launch() {
}
}()

// Setup a channel to receive a signal
done := make(chan os.Signal, 1)

signal.Notify(done, os.Interrupt)

// Fire off a goroutine to loop until that channel receives a signal.
// When a signal is received simply exit the program
go func() {
for _ = range done {
os.Exit(0)
}
}()
// print Wren AI header
fmt.Println(strings.Repeat("=", 55))
myFigure := figure.NewFigure("WrenAI", "", true)
Expand Down

0 comments on commit dfab184

Please sign in to comment.