cmd/ebitenmobile: Add hack to enable go-list at the temporary directory

This commit is contained in:
Hajime Hoshi 2020-01-21 15:07:36 +09:00
parent 732ad120c3
commit 78a1698069

View File

@ -92,6 +92,19 @@ func prepareGomobileCommands() error {
os.Chdir(pwd)
}()
// Hack to enable go-list at the temporary directory.
f, err := os.Create("main.go")
if err != nil {
return err
}
defer f.Close()
if _, err := f.WriteString("package main\n"); err != nil {
return err
}
if err := f.Sync(); err != nil {
return err
}
if err := runGo("mod", "init", "ebitenmobiletemporary"); err != nil {
return err
}