diff --git a/Taskfile.yml b/Taskfile.yml index bed5903..c0aa124 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -10,14 +10,19 @@ vars: GORUN: "{{.GOCMD}} run" GOTEST: "{{.GOCMD}} test -v" GOCOVER: "{{.GOCMD}} test -v --cover" + + # Variables to get version VERSION: sh: cd version/ && versionManager go version + ## Binary name ## WINDOWS_BINARY_NAME: ./release/windows/{{.VERSION}}/kode-starter.exe LINUX_BINARY_NAME: ./release/linux/{{.VERSION}}/kode-starter -# env: - GOOS: Linux +# faire un build pour Windows sur linux il faut installer mingw-w64 +# sudo apt-get install mingw-w64 +env: + GOOS: windows GOARCH: amd64 tasks: @@ -26,7 +31,7 @@ tasks: linux-version: cmds: - "cd ./version/ && versionManager go build" - silent: true + # silent: true ## Build ## linux-build: @@ -46,12 +51,12 @@ tasks: windows-version: cmds: - "cd ./version/ && versionManager.exe go build" - silent: true + # silent: true windows-build: cmds: - "{{.GOBUILD}} {{.WINDOWS_BINARY_NAME}} -v" - silent: true + # silent: true ## change Build version and build windows-vbuild: diff --git a/config/config.go b/config/config.go index ac384d6..0acc9a3 100644 --- a/config/config.go +++ b/config/config.go @@ -440,7 +440,7 @@ func (c *Config) Init() { c.SetModifDate(modifDate) // set config file name - var configFileYmlName string = "config.yml" + var configFileYmlName string = utils.GetProgramDir() + "/config.yml" c.SetConfigFileYmlName(configFileYmlName) // set token from environment variable diff --git a/release/linux/0.0.0.26/kode-starter b/release/linux/0.0.0.26/kode-starter new file mode 100755 index 0000000..3913cea Binary files /dev/null and b/release/linux/0.0.0.26/kode-starter differ diff --git a/release/linux/0.0.0.27/kode-starter b/release/linux/0.0.0.27/kode-starter new file mode 100755 index 0000000..ad1a0ea Binary files /dev/null and b/release/linux/0.0.0.27/kode-starter differ diff --git a/utils/utils.go b/utils/utils.go index 96faf96..1108267 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -151,3 +151,18 @@ func ColorizeSubStrRed(s string, sub string) string { func DoubleBackSlash(s string) string { return strings.Replace(s, "\\", "\\\\", -1) } + +// function that return the program current directory +func GetProgramDir() string { + + // get the absolut path of the executable + ex, err := os.Executable() + if err != nil { + panic(err) + } + + // get the directory of the executable + exPath := filepath.Dir(ex) + + return exPath +} diff --git a/version/version-number.go b/version/version-number.go index 3b37533..7529196 100644 --- a/version/version-number.go +++ b/version/version-number.go @@ -15,7 +15,7 @@ type Version struct { // version variable that will be set at build time by versionManager.exe // *** DO NOT EDIT *** -var versionNumber Version = Version{0, 0, 0, 26} +var versionNumber Version = Version{0, 0, 0, 28} // GetFullVersion returns the full version number as a string func GetFullVersion() string {