diff --git a/lists/lists.go b/lists/lists.go index 8801a57..0dec47a 100644 --- a/lists/lists.go +++ b/lists/lists.go @@ -29,8 +29,11 @@ var ListCmd = &cobra.Command{ // if -o flag is set, list projects for that org if config.GetListOrganisationFlag() { - fmt.Println("\nList projects for org: " + config.GetListOrganisation() + "\n") - fmt.Println(utils.CreateLine(6)) + if !config.GetJsonFlag() { + utils.PrintHeader() + fmt.Println("\nList projects for org: " + config.GetListOrganisation() + "\n") + fmt.Println(utils.CreateLine(6)) + } projects, err := ListProjects(config.GetListOrganisation()) if err != nil { fmt.Println("Error:", err) @@ -45,8 +48,10 @@ var ListCmd = &cobra.Command{ fmt.Println("Error:", err) return } - fmt.Println("\nList of Organizations :") - fmt.Println(utils.CreateLine(4)) + if !config.GetJsonFlag() { + fmt.Println("\nList of Organizations :") + fmt.Println(utils.CreateLine(4)) + } for _, org := range orgs { fmt.Print(org) } diff --git a/makefile b/makefile index 32fb235..cdd09b8 100644 --- a/makefile +++ b/makefile @@ -6,21 +6,38 @@ GOTEST=$(GOCMD) test GOGET=$(GOCMD) get # Binary name -BINARY_NAME=kode-starter +WINDOWS_BINARY_NAME=./release/windows/kode-starter.exe +LINUX_BINARY_NAME=./release/linux/kode-starter +# test, build, clean, release all: test build -build: - $(GOBUILD) -o $(BINARY_NAME) -v +# build +build-windows: + cd ./version/ && versionManager.exe go build + cd .. + set GOOS=windows + set GOARCH=amd64 + $(GOBUILD) -o $(WINDOWS_BINARY_NAME) -v + +build-linux: + cd ./version/ && versionManager.exe go build + cd .. + set GOOS=linux + set GOARCH=amd64 + $(GOBUILD) -o $(LINUX_BINARY_NAME) -v + +build-all: build-windows build-linux test: $(GOTEST) -v ./... clean: $(GOCLEAN) - rm -f $(BINARY_NAME) + powershell.exe -c "rm .\release\ -Recurse -Force" release: clean - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -v + cd ./version/ && versionManager.exe go release + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(WINDOWS_BINARY_NAME) -v .PHONY: all build test clean release \ No newline at end of file diff --git a/release/linux/kode-starter b/release/linux/kode-starter new file mode 100644 index 0000000..45fb8ed Binary files /dev/null and b/release/linux/kode-starter differ diff --git a/release/windows/kode-starter.exe b/release/windows/kode-starter.exe new file mode 100644 index 0000000..8b5f8a4 Binary files /dev/null and b/release/windows/kode-starter.exe differ diff --git a/version/VERSION b/version/VERSION deleted file mode 100644 index 726017f..0000000 --- a/version/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.1.0.0 \ No newline at end of file diff --git a/version/version-number.go b/version/version-number.go index 5cff710..b8444d5 100644 --- a/version/version-number.go +++ b/version/version-number.go @@ -1,7 +1,11 @@ package version +// This file is generated automatically by versionManager.exe. +// DO NOT EDIT THIS FILE. +// Any changes made to this file will be overwritten the next time versionManager.exe is run. import "fmt" +// Version is a struct that contains the version number type Version struct { Major int Minor int @@ -9,24 +13,31 @@ type Version struct { Build int } -var versionNumber Version = Version{0, 1, 0, 0} +// version variable that will be set at build time by versionManager.exe +// *** DO NOT EDIT *** +var versionNumber Version = Version{0, 0, 0, 7} +// GetFullVersion returns the full version number as a string func GetFullVersion() string { return fmt.Sprintf("%d.%d.%d.%d", versionNumber.Major, versionNumber.Minor, versionNumber.Patch, versionNumber.Build) } +// GetMajorVersion returns the major version number as a string func GetMajorVersion() string { return fmt.Sprintf("%d", versionNumber.Major) } +// GetMinorVersion returns the minor version number as a string func GetMinorVersion() string { return fmt.Sprintf("%d", versionNumber.Minor) } +// GetPatchVersion returns the patch version number as a string func GetPatchVersion() string { return fmt.Sprintf("%d", versionNumber.Patch) } +// GetBuildVersion returns the build version number as a string func GetBuildVersion() string { return fmt.Sprintf("%d", versionNumber.Build) } diff --git a/version/version.exe b/version/version.exe deleted file mode 100644 index d8bda24..0000000 Binary files a/version/version.exe and /dev/null differ