From 481a05f1165159124a4f9b0f50deff27fdffc26d Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 9 Aug 2018 12:55:41 +1000 Subject: [PATCH] check for VERSION file in project directory rather than current directory --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 6ad705dd1..eaf0c5a1d 100644 --- a/main.go +++ b/main.go @@ -74,9 +74,10 @@ func navigateToRepoRootDirectory() { // 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 { - byteVersion, err := ioutil.ReadFile("VERSION") + gopath := os.Getenv("GOPATH") + byteVersion, err := ioutil.ReadFile(gopath + "/src/github.com/jesseduffield/lazygit/VERSION") if err != nil { - log.Panicln(err.Error()) + return "unversioned" } return string(byteVersion) }