forked from joejulian/gio-cmd
gogio: fix #633 wasm_exec.js location for go1.24
Signed-off-by: Thomas Bruyelle <thomas.bruyelle@gmail.com>
This commit is contained in:
committed by
Elias Naur
parent
03a1ada8ac
commit
37612f9112
+6
-1
@@ -78,10 +78,15 @@ func buildJS(bi *buildInfo) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
wasmJS := filepath.Join(goroot, "misc", "wasm", "wasm_exec.js")
|
||||
// Location of the wasm_exec.js for go>=1.24
|
||||
wasmJS := filepath.Join(goroot, "lib", "wasm", "wasm_exec.js")
|
||||
if _, err := os.Stat(wasmJS); err != nil {
|
||||
// Location of the wasm_exec.js for go<1.24
|
||||
wasmJS = filepath.Join(goroot, "misc", "wasm", "wasm_exec.js")
|
||||
if _, err := os.Stat(wasmJS); err != nil {
|
||||
return fmt.Errorf("failed to find $GOROOT/misc/wasm/wasm_exec.js driver: %v", err)
|
||||
}
|
||||
}
|
||||
pkgs, err := packages.Load(&packages.Config{
|
||||
Mode: packages.NeedName | packages.NeedFiles | packages.NeedImports | packages.NeedDeps,
|
||||
Env: append(os.Environ(), "GOOS=js", "GOARCH=wasm"),
|
||||
|
||||
Reference in New Issue
Block a user