check for VERSION file in project directory rather than current directory

This commit is contained in:
Jesse Duffield 2018-08-09 12:55:41 +10:00
parent 6e8abbcdda
commit 481a05f116

View file

@ -74,9 +74,10 @@ func navigateToRepoRootDirectory() {
// with `date` and `commit`. If this program has been opened directly via go, // 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 // we will populate the `version` with VERSION in the lazygit root directory
func fallbackVersion() string { func fallbackVersion() string {
byteVersion, err := ioutil.ReadFile("VERSION") gopath := os.Getenv("GOPATH")
byteVersion, err := ioutil.ReadFile(gopath + "/src/github.com/jesseduffield/lazygit/VERSION")
if err != nil { if err != nil {
log.Panicln(err.Error()) return "unversioned"
} }
return string(byteVersion) return string(byteVersion)
} }