Commit 35657cf6e7

35657cf6e7eaff7e2714b4fd9dc2fa20c4e3d293

parent: 8cd406d18c

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-18 19:50 UTC

fix: graceful exit

Layout: unified · split

cmd/curd/main.go +8
@@ -74,9 +74,16 @@ func main(){
7474
7575 if err != nil{
7676 fmt.Println("No episode list found")
77 internal.RestoreScreen()
7778 os.Exit(1)
7879 }
7980
81 if episodeList == nil { // if user selected "Add new anime option"
82 fmt.Println("Add new anime")
83 internal.RestoreScreen()
84 os.Exit(0)
85 }
86
8087 internal.Log(episodeList, logFile)
8188 var episodeNumber string
8289 fmt.Printf("Enter the episode (%v episodes)", episodeList[len(episodeList)-1])
@@ -98,6 +105,7 @@ func main(){
98105
99106 if err != nil {
100107 internal.Log("Failed to start mpv", logFile)
108 os.Exit(1)
101109 }
102110
103111 for { // Loop while video is playing