diff options
author | Ayke van Laethem <[email protected]> | 2022-02-16 18:38:03 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-02-20 16:35:20 +0100 |
commit | 5746154cc081b0bbf46097d8bac6eecf3a68ffec (patch) | |
tree | 78addc0e80877c17440f652d08829b7eced4308c /builder | |
parent | e9d9ae878115a04ec81727ae546f149fae0b7747 (diff) | |
download | tinygo-5746154cc081b0bbf46097d8bac6eecf3a68ffec.tar.gz tinygo-5746154cc081b0bbf46097d8bac6eecf3a68ffec.zip |
all: add -work flag
This flag has the same behavior as in upstream Go. It can be useful
while debugging certain issues.
Diffstat (limited to 'builder')
-rw-r--r-- | builder/build.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builder/build.go b/builder/build.go index c4831de02..4e73bd096 100644 --- a/builder/build.go +++ b/builder/build.go @@ -99,7 +99,11 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil if err != nil { return err } - defer os.RemoveAll(dir) + if config.Options.Work { + fmt.Printf("WORK=%s\n", dir) + } else { + defer os.RemoveAll(dir) + } // Check for a libc dependency. // As a side effect, this also creates the headers for the given libc, if |