Configurable version suffix independent of version number

This commit is contained in:
albertony 2022-02-04 23:46:12 +01:00 committed by Nick Craig-Wood
parent 4f0ddb60e7
commit ce168ecac2
4 changed files with 24 additions and 6 deletions

View File

@ -245,18 +245,18 @@ retag:
startdev:
@echo "Version is $(VERSION)"
@echo "Next version is $(NEXT_VERSION)"
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEXT_VERSION)-DEV\"\n" | gofmt > fs/version.go
echo -e "package fs\n\n// VersionTag of rclone\nvar VersionTag = \"$(NEXT_VERSION)\"\n" | gofmt > fs/versiontag.go
echo -n "$(NEXT_VERSION)" > docs/layouts/partials/version.html
echo "$(NEXT_VERSION)" > VERSION
git commit -m "Start $(NEXT_VERSION)-DEV development" fs/version.go VERSION docs/layouts/partials/version.html
git commit -m "Start $(NEXT_VERSION)-DEV development" fs/versiontag.go VERSION docs/layouts/partials/version.html
startstable:
@echo "Version is $(VERSION)"
@echo "Next stable version is $(NEXT_PATCH_VERSION)"
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEXT_PATCH_VERSION)-DEV\"\n" | gofmt > fs/version.go
echo -e "package fs\n\n// VersionTag of rclone\nvar VersionTag = \"$(NEXT_PATCH_VERSION)\"\n" | gofmt > fs/versiontag.go
echo -n "$(NEXT_PATCH_VERSION)" > docs/layouts/partials/version.html
echo "$(NEXT_PATCH_VERSION)" > VERSION
git commit -m "Start $(NEXT_PATCH_VERSION)-DEV development" fs/version.go VERSION docs/layouts/partials/version.html
git commit -m "Start $(NEXT_PATCH_VERSION)-DEV development" fs/versiontag.go VERSION docs/layouts/partials/version.html
winzip:
zip -9 rclone-$(TAG).zip rclone.exe

View File

@ -1,4 +1,14 @@
package fs
// Version of rclone
var Version = "v1.59.0-DEV"
// Version of rclone containing the complete version string
var Version string
func init() {
if Version == "" {
if VersionSuffix == "" {
Version = VersionTag
} else {
Version = VersionTag + "-" + VersionSuffix
}
}
}

4
fs/versionsuffix.go Normal file
View File

@ -0,0 +1,4 @@
package fs
// VersionSuffix of rclone containing the pre-release label if any
var VersionSuffix = "DEV"

4
fs/versiontag.go Normal file
View File

@ -0,0 +1,4 @@
package fs
// VersionTag of rclone
var VersionTag = "v1.59.0"