1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-23 21:51:07 +02:00

remove VERSION file

This commit is contained in:
Jesse Duffield 2018-08-19 20:04:57 +10:00
parent 21be9fb3b1
commit 2008607108
2 changed files with 0 additions and 17 deletions

View File

@ -1 +0,0 @@
v0.1.72

16
main.go
View File

@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
@ -26,23 +25,8 @@ func projectPath(path string) string {
return filepath.FromSlash(gopath + "/src/github.com/jesseduffield/lazygit/" + path)
}
// when building the binary, `version` is set as a compile-time variable, along
// with `date` and `commit`. If this program has been opened directly via go,
// we will populate the `version` with VERSION in the lazygit root directory
func fallbackVersion() string {
path := projectPath("VERSION")
byteVersion, err := ioutil.ReadFile(path)
if err != nil {
return "unversioned"
}
return string(byteVersion)
}
func main() {
flag.Parse()
if version == "unversioned" {
version = fallbackVersion()
}
if *versionFlag {
fmt.Printf("commit=%s, build date=%s, version=%s, os=%s, arch=%s\n", commit, date, version, runtime.GOOS, runtime.GOARCH)
os.Exit(0)