mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
platform independent path reading
This commit is contained in:
parent
5cc34e7801
commit
1f5f80b1bf
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/user"
|
"os/user"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
|
@ -75,7 +76,8 @@ func navigateToRepoRootDirectory() {
|
||||||
// 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 {
|
||||||
gopath := os.Getenv("GOPATH")
|
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 {
|
if err != nil {
|
||||||
return "unversioned"
|
return "unversioned"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue