From cc72b929326f79cf2a33d7216b2f11b1ad610f0c Mon Sep 17 00:00:00 2001 From: penguinehis Date: Sat, 11 Jul 2026 02:07:00 -0300 Subject: [PATCH] Fix Update --- update_status.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_status.go b/update_status.go index 55c7106..fa060e2 100644 --- a/update_status.go +++ b/update_status.go @@ -86,13 +86,13 @@ func getUpdateStatus(parent context.Context, force bool) updateStatusResponse { } func checkRemoteUpdate(parent context.Context) updateStatusResponse { - repoURL := firstNonEmpty( + repoURL := firstNonEmptyTrimmed( strings.TrimSpace(os.Getenv("DRAGON_UPDATE_REPO_URL")), readSingleLineFile("/opt/sshpanel/.installed_repo_url"), strings.TrimSpace(buildRepoURL), defaultUpdateRepoURL, ) - branch := firstNonEmpty( + branch := firstNonEmptyTrimmed( strings.TrimSpace(os.Getenv("DRAGON_UPDATE_BRANCH")), strings.TrimSpace(buildBranch), readSingleLineFile("/opt/sshpanel/.installed_branch"), @@ -235,7 +235,7 @@ func readSingleLineFile(path string) string { return line } -func firstNonEmpty(values ...string) string { +func firstNonEmptyTrimmed(values ...string) string { for _, value := range values { if strings.TrimSpace(value) != "" { return strings.TrimSpace(value)