Allowing to specify different branch in first parameter

This commit is contained in:
David Vennik
2022-12-21 14:34:17 +00:00
parent 67f0897c62
commit aece9e51c7
2 changed files with 16 additions and 17 deletions

View File

@@ -129,17 +129,6 @@ func main() {
); check(e) {
return
}
switch {
case minor:
Minor++
Patch = 0
case major:
Major++
Minor = 0
Patch = 0
default:
Patch++
}
startArgs := 1
br := strings.Split(GitRef, "/")
branch := br[len(br)-1]
@@ -168,11 +157,21 @@ func main() {
}
tag := true
if branch == "main" {
// Update SemVer
SemVer = fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch)
switch {
case minor:
Minor++
Patch = 0
case major:
Major++
Minor = 0
Patch = 0
default:
Patch++
}
} else {
tag = false
}
SemVer = fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch)
PathBase = tr.Filesystem.Root() + "/"
versionFile := `// Package indra is the root level package for Indranet, a low latency,
// Lightning Network monetised distributed VPN protocol designed for providing

View File

@@ -13,11 +13,11 @@ var (
// GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/main"
// ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "395f888f11a92d6b19967c8f0e89cc25fef1105c"
ParentGitCommit = "dc145aa1d24085eaf3b5c5f93096822fbda1be75"
// BuildTime stores the time when the current binary was built.
BuildTime = "2022-12-21T14:31:39Z"
BuildTime = "2022-12-21T14:34:17Z"
// SemVer lists the (latest) git tag on the build.
SemVer = "v0.0.205"
SemVer = "v0.0.206"
// PathBase is the path base returned from runtime caller.
PathBase = "/home/loki/src/github.com/Indra-Labs/indra/"
// Major is the major number from the tag.
@@ -25,7 +25,7 @@ var (
// Minor is the minor number from the tag.
Minor = 0
// Patch is the patch version number from the tag.
Patch = 205
Patch = 206
)
// Version returns a pretty printed version information string.