WrenAI icon indicating copy to clipboard operation
WrenAI copied to clipboard

Installation should stop when exiting the launcher

Open chilijung opened this issue 1 year ago • 5 comments

Describe the bug as title

To Reproduce Steps to reproduce the behavior:

  1. start launcher
  2. when selecting openai or others
  3. hit ctrl + c to exit
  4. it continues to install

Expected behavior should exit the command

Screenshots image

chilijung avatar Jul 12 '24 05:07 chilijung

Hi Team, I would like to look into this issue. Could you assign it to me

Prototype4988 avatar Oct 05 '24 16:10 Prototype4988

@Prototype4988 Here you go!

chilijung avatar Oct 05 '24 16:10 chilijung

Hi Team, I have done the fix attaching the screenshot from console below

image

Prototype4988 avatar Oct 05 '24 18:10 Prototype4988

I have added the below code snippet in Launch() function

`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)
    }
}()`

Prototype4988 avatar Oct 05 '24 18:10 Prototype4988

Let me know what you think of this approach

Prototype4988 avatar Oct 05 '24 18:10 Prototype4988

PR is merged!

chilijung avatar Oct 21 '24 12:10 chilijung