mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
build: Handle split GOPATH
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4447
This commit is contained in:
parent
20fac4bb80
commit
46becc5338
13
build.go
13
build.go
@ -218,11 +218,18 @@ func main() {
|
||||
os.Setenv("GOPATH", gopath)
|
||||
log.Println("GOPATH is", gopath)
|
||||
} else {
|
||||
gopath, _ = filepath.EvalSymlinks(gopath)
|
||||
inside := false
|
||||
wd, _ := os.Getwd()
|
||||
wd, _ = filepath.EvalSymlinks(wd)
|
||||
if filepath.Join(gopath, "src/github.com/syncthing/syncthing") != wd {
|
||||
fmt.Println("You are running this outside of GOPATH/src/github.com/syncthing/syncthing, this might cause failure!")
|
||||
for _, p := range filepath.SplitList(gopath) {
|
||||
p, _ = filepath.EvalSymlinks(p)
|
||||
if filepath.Join(p, "src/github.com/syncthing/syncthing") == wd {
|
||||
inside = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !inside {
|
||||
fmt.Println("You seem to have GOPATH set but the Syncthing source not placed correctly within it, which may cause problems.")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user