cmd/ebitenmobile: Enable to specify the package

If a package is not specified, the current directory (.) is adopted.
This commit is contained in:
Hajime Hoshi 2020-07-22 00:51:47 +09:00
parent ec9863dfef
commit 283de9b847

View File

@ -166,7 +166,11 @@ func doBind(args []string, flagset *flag.FlagSet, buildOS string) error {
} }
cfg.BuildFlags = []string{"-tags", tags} cfg.BuildFlags = []string{"-tags", tags}
pkgs, err := packages.Load(cfg, flagset.Args()[0]) flagsetArgs := flagset.Args()
if len(flagsetArgs) == 0 {
flagsetArgs = []string{"."}
}
pkgs, err := packages.Load(cfg, flagsetArgs[0])
if err != nil { if err != nil {
return err return err
} }