mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 12:04:03 +00:00
main: refactor environment variables into a separate package
This makes it possible to query these environment variables from anywhere, which might be useful. More importantly, it puts them in a central location from where they can be queried, useful for a `go env` subcommand.
This commit is contained in:
committed by
Ron Evans
parent
2a71aa90bc
commit
2463153a8c
+3
-1
@@ -9,6 +9,8 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"unsafe"
|
||||
|
||||
"github.com/tinygo-org/tinygo/goenv"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -63,7 +65,7 @@ func Link(linker string, flags ...string) error {
|
||||
cmd := exec.Command(linker, flags...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Dir = sourceDir()
|
||||
cmd.Dir = goenv.Get("TINYGOROOT")
|
||||
return cmd.Run()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user