Commit graph

7 commits

Author SHA1 Message Date
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
32f9a462a8 Speed up build script by avoiding recursing into 3rd-party directories 2021-06-15 17:32:43 +02:00
Mislav Marohnić
cda406f495 Better error handling in build script on Windows
`script/build.go` could encounter an "Access is denied" error when the
project contains a symlink that could not be followed. This ignores such
errors with a warning and allows the build to resume.
2021-06-15 17:31:01 +02:00
Mislav Marohnić
d43720620e Tweak build scripts to enable cross-compiling
The main build script for this project is `script/build.go` which
implements Makefile-like building of the `gh` binary and associated man
pages. Our Makefile defers to the Go script.

However, when setting GOOS, GOARCH, and other environment variables to
modify the target for the resulting binary, these environment variables
would affect the execution of `build.go` as well, which was unintended.

This tweaks our Makefile to reset variables like GOOS and GOARCH when
building the `build.go` script itself, ensuring that the built script
runs on the same platform, and adds the ability to pass environment
variables as arguments to `go run script/build.go`. This allows the
following usage on platforms without `make`:

    go run script/build.go GOOS=linux

With this style of invocation, the GOOS setting does not actually affect
`go run` itself; just the `go build` that is executed in a child process.
2021-04-09 15:48:12 +02:00
xvqxy
9920ea97f6
Display output of build commands.
This fixes #2920.

Print out output of executed command to stdout/stderr.
2021-02-06 09:49:53 +01:00
Mislav Marohnić
39431a101d Port select portions of Makefile to script/build.go
This is to enable build tasks on Windows.
2021-01-08 22:35:57 +01:00