From 8f23db8a6ebae807655e832ec5264a009fdc250a Mon Sep 17 00:00:00 2001 From: Timo Reichl Date: Fri, 6 Oct 2023 17:31:55 +0000 Subject: [PATCH] main/xdeb: Fix receiving the 'latest' version of xdeb Signed-off-by: Timo Reichl --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index a190623..8758fe6 100644 --- a/main.go +++ b/main.go @@ -285,11 +285,12 @@ func prepare(context *cli.Context) error { return fmt.Errorf("could not follow URL '%s'", urlPrefix) } - // install latest release tag - urlPrefix = resp.Request.URL.String() - } else { - urlPrefix = fmt.Sprintf("%s/download/%s", xdeb.XDEB_URL, version) + // get latest release version + releaseUrl := resp.Request.URL.String() + version = releaseUrl[strings.LastIndex(releaseUrl, "/")+1:] } + + urlPrefix = fmt.Sprintf("%s/download/%s", xdeb.XDEB_URL, version) } url := fmt.Sprintf("%s/xdeb", urlPrefix)