File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 18183 . Build and install
1919
2020 #### Unix-like systems
21+
2122 ``` sh
2223 # installs to '/usr/local' by default; sudo may be required, or sudo -E for configured go environments
2324 $ make install
2728 ```
2829
2930 #### Windows
31+
3032 ``` pwsh
3133 # build the `bin\gh.exe` binary
3234 > go run script\build.go
3335 ```
36+
3437 There is no install step available on Windows.
3538
36394 . Run ` gh version ` to check if it worked.
3740
3841 #### Windows
42+
3943 Run ` bin\gh version ` to check if it worked.
4044
4145## Cross-compiling binaries for different platforms
@@ -44,10 +48,12 @@ You can use any platform with Go installed to build a binary that is intended fo
4448or CPU architecture. This is achieved by setting environment variables such as GOOS and GOARCH.
4549
4650For example, to compile the ` gh ` binary for the 32-bit Raspberry Pi OS:
51+
4752``` sh
4853# on a Unix-like system:
4954$ GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 make clean bin/gh
5055```
56+
5157``` pwsh
5258# on Windows, pass environment variables as arguments to the build script:
5359> go run script\build.go clean bin\gh GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0
You can’t perform that action at this time.
0 commit comments