Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit 260c808

Browse files
author
Cole Gleason
committed
fix(watch): don't export UPDATE_SERVICE_URL if there is no update
1 parent 45a204e commit 260c808

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

watch.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ func prepareEnvironment(appID string, version string, oldVersion string, updateC
9696
}
9797
env = append(env, "UPDATE_SERVICE_APP_ID="+appID)
9898

99-
url, err := url.Parse(updateCheck.Urls.Urls[0].CodeBase)
100-
if err != nil {
101-
fmt.Fprintf(os.Stderr, err.Error())
102-
os.Exit(1)
103-
}
99+
if updateCheck.Status == "ok" {
100+
url, err := url.Parse(updateCheck.Urls.Urls[0].CodeBase)
101+
if err != nil {
102+
fmt.Fprintf(os.Stderr, err.Error())
103+
os.Exit(1)
104+
}
104105

105-
url.Path = path.Join(url.Path, updateCheck.Manifest.Packages.Packages[0].Name)
106-
env = append(env, "UPDATE_SERVICE_URL="+url.String())
106+
url.Path = path.Join(url.Path, updateCheck.Manifest.Packages.Packages[0].Name)
107+
env = append(env, "UPDATE_SERVICE_URL="+url.String())
108+
}
107109
return env
108110
}
109111

0 commit comments

Comments
 (0)