summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-09 12:55:41 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-09 12:55:41 +1000
commit481a05f1165159124a4f9b0f50deff27fdffc26d (patch)
tree51c2c732ce98111bf930ea9c7fbf58a41a61bdfc /main.go
parent6e8abbcddad641a000c45985b22a8d0899f02781 (diff)
check for VERSION file in project directory rather than current directory
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files 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)
}