mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
fix: us build default
This commit is contained in:
parent
a332d9564f
commit
e65c0a168e
4
build.go
4
build.go
@ -62,7 +62,7 @@ func getPathForTarget(gomod config.Namespace, goPath string, target *config.Targ
|
||||
}
|
||||
}
|
||||
|
||||
func Build(conf *config.Config, goRoot, goPath string) { //nolint:maintidx
|
||||
func Build(conf *config.Config, goPath string, goSources []string) { //nolint:maintidx
|
||||
deriveCommonJSMapping(conf)
|
||||
|
||||
mappedTypeScript := map[string]map[string]*code{}
|
||||
@ -119,7 +119,7 @@ func Build(conf *config.Config, goRoot, goPath string) { //nolint:maintidx
|
||||
}
|
||||
vendorDirectory := path.Join(workDirectory, "vendor")
|
||||
|
||||
goPaths := []string{goPath, goRoot}
|
||||
goPaths := append(goSources, goPath)
|
||||
|
||||
if _, err := os.Stat(vendorDirectory); !os.IsNotExist(err) {
|
||||
goPaths = append(goPaths, vendorDirectory)
|
||||
|
||||
@ -35,21 +35,11 @@ func main() {
|
||||
}
|
||||
gotsrpc.ReaderTrace = *flagDebug
|
||||
|
||||
// check if GOPATH has been set as env variable
|
||||
// if not use the default from the build pkg
|
||||
goPath := os.Getenv("GOPATH")
|
||||
if goPath == "" {
|
||||
goPath = build.Default.GOPATH
|
||||
}
|
||||
goRoot := os.Getenv("GOROOT")
|
||||
if goPath == "" {
|
||||
goPath = build.Default.GOROOT
|
||||
}
|
||||
|
||||
conf, err := config.LoadConfigFile(args[0])
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "config load error, could not load config from", args[0], ":", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
gotsrpc.Build(conf, goRoot, goPath)
|
||||
|
||||
gotsrpc.Build(conf, build.Default.GOPATH, build.Default.SrcDirs())
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user