fix(update): actually execute install script when updating (#26)

This commit is contained in:
VERSE
2026-07-03 19:53:59 +07:00
committed by GitHub
parent ee1ef2dd73
commit 37b0651651
+11 -1
View File
@@ -7,6 +7,7 @@ import (
"io" "io"
"net/http" "net/http"
"os" "os"
"os/exec"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@@ -244,7 +245,16 @@ var updateCmd = &cobra.Command{
// download and replace the binary using the install script // download and replace the binary using the install script
installScript := "https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh" 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 // after a successful update, mark as seen so no more notifications
state := config.LoadState() state := config.LoadState()