aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorRandy Reddig <[email protected]>2024-08-21 02:03:02 +0200
committerGitHub <[email protected]>2024-08-20 17:03:02 -0700
commit336b9b33ab9dc51235519d0a7ce2116fe44fbe4e (patch)
tree91e9f57bce69c45637e245422ce47f81aa26e869 /main.go
parentef4f46f1d1550beb62324d750c496b2b4a7f76d0 (diff)
downloadtinygo-336b9b33ab9dc51235519d0a7ce2116fe44fbe4e.tar.gz
tinygo-336b9b33ab9dc51235519d0a7ce2116fe44fbe4e.zip
tinygo: detect GOOS=wasip1 for relative WASI paths via config instead of target name (#4423)
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.go b/main.go
index 8f788efb8..51e62aaae 100644
--- a/main.go
+++ b/main.go
@@ -305,13 +305,11 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
//
// Ex. run --dir=.. --dir=../.. --dir=../../..
var dirs []string
- switch config.Options.Target {
+ switch config.Target.GOOS {
case "wasip1":
dirs = dirsToModuleRootRel(result.MainDir, result.ModuleRoot)
- case "wasip2":
- dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
default:
- return fmt.Errorf("unknown GOOS target: %v", config.Options.Target)
+ dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
}
args := []string{"run"}