From 37b0651651459c62d0677fbb22026e446084d2d2 Mon Sep 17 00:00:00 2001 From: VERSE Date: Fri, 3 Jul 2026 19:53:59 +0700 Subject: [PATCH] fix(update): actually execute install script when updating (#26) --- root/update.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/root/update.go b/root/update.go index c05d812..5585fc9 100644 --- a/root/update.go +++ b/root/update.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "os" + "os/exec" "strconv" "strings" "time" @@ -244,7 +245,16 @@ var updateCmd = &cobra.Command{ // download and replace the binary using the install script installScript := "https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh" - fmt.Printf("running: curl -sS %s | sh\n\n", installScript) + fmt.Printf("running: curl -sSL %s | sh\n\n", installScript) + + cmdRun := exec.Command("sh", "-c", "curl -sSL "+installScript+" | sh") + cmdRun.Stdout = os.Stdout + cmdRun.Stderr = os.Stderr + cmdRun.Stdin = os.Stdin + if err := cmdRun.Run(); err != nil { + fmt.Printf("\n\033[31m[IRIS] update failed: %v\033[0m\n", err) + return + } // after a successful update, mark as seen so no more notifications state := config.LoadState()