1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-26 09:00:57 +02:00

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,
// 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)
}