diff --git a/Makefile b/Makefile index b61d14a..a776923 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,9 @@ curl-setCurrent-go-wit-com-gui: curl-setTargetVersion-virtigo-v0.1.1: curl --silent http://localhost:9419/setTargetVersion?version=v0.1.1 +curl-setTargetVersion-go-clone-v0.6: + curl --silent "http://localhost:9419/setTargetVersion?repo=go-clone&version=v0.6" + curl-incrementAllTargetVersions: curl --silent http://localhost:9419/setAllTargetVersions diff --git a/http.go b/http.go index 45a5153..f59c3bb 100644 --- a/http.go +++ b/http.go @@ -92,7 +92,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { log.Info("version: " + version) log.Info("comment: " + comment) - repo := me.repos.View.FindRepoByName(repoName) + repo := me.repos.View.FindByName(repoName) if repo == nil { log.Info("FindRepoByName() returned nil") return @@ -120,11 +120,23 @@ func okHandler(w http.ResponseWriter, r *http.Request) { case "/setTargetVersion": log.Info("repo: " + repoName) log.Info("version: " + version) + if repoName != "" { + repo := me.repos.View.FindByName(repoName) + if repo == nil { + log.Info("could not find repo", repoName) + } else { + log.Info("setting target version", version) + repo.Status.SetTargetVersion(version) + } + return + } + if me.current == nil { log.Info("me.current == nil") return } me.current.Status.SetTargetVersion(version) + return case "/setAllTargetVersions": log.Info("version: " + version) @@ -141,7 +153,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } } case "/whitelist": - repo := me.repos.View.FindRepoByName(repoName) + repo := me.repos.View.FindByName(repoName) if repo == nil { log.Info("FindRepoByName() returned nil") return