forked from joejulian/gio
cmd/gio: use the import path as basis for the output file
Before this change `go list <pkg>` was used to sanitize the import
path of the package argument. That doesn't work well for building
Go source files directly:
gio -target android helloworld.go
where `go list helloworld.go` simply returns "command-line-arguments".
A better way is to leave the package path alone, and compute the
output file separately from the import path, as reported by
`go list -f {{.ImportPath}} <pkg>`.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ import (
|
||||
func buildJS(bi *buildInfo) error {
|
||||
out := *destPath
|
||||
if out == "" {
|
||||
out = filepath.Base(bi.pkg)
|
||||
out = bi.name
|
||||
}
|
||||
if err := os.MkdirAll(out, 0700); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user