summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-09 13:21:30 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-09 13:21:30 +1000
commit1f5f80b1bf36a94bbe8994f7bb164793a3c27f21 (patch)
tree6307c8fc4e77dfcd7848daa8cc58fb7cef17c187 /main.go
parent5cc34e780154bbf6bc3233fe52b60d22c87cb072 (diff)
platform independent path reading
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index eaf0c5a1d..1e0a26eed 100644
--- a/main.go
+++ b/main.go
@@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"os/user"
+ "path/filepath"
"time"
"github.com/fatih/color"
@@ -75,7 +76,8 @@ func navigateToRepoRootDirectory() {
// we will populate the `version` with VERSION in the lazygit root directory
func fallbackVersion() string {
gopath := os.Getenv("GOPATH")
- byteVersion, err := ioutil.ReadFile(gopath + "/src/github.com/jesseduffield/lazygit/VERSION")
+ path := filepath.FromSlash(gopath + "/src/github.com/jesseduffield/lazygit/VERSION")
+ byteVersion, err := ioutil.ReadFile(path)
if err != nil {
return "unversioned"
}