From d86d54d2ec73bec9ca441e3ded918acbe7cfa1b9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 2 Jun 2023 20:01:50 +0200 Subject: [PATCH] fixed copy if version is already uploaded --- main.go | 2 +- release.go | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index e16faae..53c277c 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ func main() { br := *branch version := readVersions(*branch) var source_dir_branch string = sdir + br + "/images/" - var target_dir_branch string = tdir + br + "/images/" + var target_dir_branch string = tdir + br + "/" if is_firmware_folder(source_dir_branch) { //generate manifest file for branch diff --git a/release.go b/release.go index faef05e..3b82e40 100644 --- a/release.go +++ b/release.go @@ -19,13 +19,18 @@ func release_branch(b string, sDir string, tDir string, dryrun bool, v string) { } sVersion := GetGluonVersion(sDir) tVersion := GetGluonVersion(tDir) + fmt.Println("Target Version: ", tVersion) + fmt.Println("Source Version: ", sVersion) + fmt.Println("Wanted Version: ", v) //check wanted version in target - if tVersion != v { - log.Println("published version is outdated, try to update from source folder") - if sVersion != v { - log.Println("wanted Version is not availible in source folder") - os.Exit(1) - } + if tVersion == v { + log.Println("wanted version is already published!") + os.Exit(0) + } + log.Println("published version is outdated, try to update from source folder") + if sVersion != v { + log.Println("wanted Version is not availible in source folder") + os.Exit(1) } if newImages {