@@ -7,6 +7,7 @@ time from OpenAPI specs, so they always match the specs.
77
88- [ Build from source] ( #build-from-source )
99- [ Install a released binary] ( #install-a-released-binary )
10+ - [ Download the archive yourself] ( #download-the-archive-yourself )
1011- [ Commands] ( #commands )
1112 - [ Auth] ( #auth )
1213 - [ Named profiles] ( #named-profiles )
@@ -42,9 +43,9 @@ The OpenAPI specs the commands are generated from are vendored in
4243
4344## Install a released binary
4445
45- Mapbox publishes signed builds for macOS, Linux and Windows from a separate
46- repository. The install script detects your platform, checks a SHA-256
47- checksum, and installs ` mapbox ` . No ` sudo ` , no admin rights:
46+ Mapbox publishes builds for macOS, Linux and Windows. The install script
47+ detects your platform, checks a SHA-256 checksum, and installs ` mapbox ` .
48+ No ` sudo ` , no admin rights:
4849
4950``` sh
5051curl -fsSL https://cli.mapbox.com/install.sh | sh
@@ -60,6 +61,65 @@ them end to end without touching the network.
6061
6162Run ` mapbox --help ` once it's on your ` PATH ` .
6263
64+ ### Download the archive yourself
65+
66+ Nothing about the install script is required. If piping one into a shell is
67+ not allowed where you work, the archives are ordinary HTTP downloads, and
68+ ` manifest.json ` lists every target with its checksum:
69+
70+ ``` sh
71+ curl -fsSL https://cli.mapbox.com/latest/manifest.json
72+ ```
73+
74+ Five targets are published: ` aarch64-apple-darwin ` , ` x86_64-apple-darwin ` ,
75+ ` aarch64-unknown-linux-musl ` , ` x86_64-unknown-linux-musl ` and
76+ ` x86_64-pc-windows-msvc ` . Pick yours, check it, then extract:
77+
78+ ``` sh
79+ version=v0.2.1
80+ file=mapbox-${version} -aarch64-apple-darwin.tar.gz
81+
82+ curl -fsSLO " https://cli.mapbox.com/${version} /${file} "
83+ curl -fsSL " https://cli.mapbox.com/${version} /SHA256SUMS" |
84+ grep " $file " | shasum -a 256 -c -
85+
86+ tar -xzf " $file "
87+ mv mapbox ~ /.local/bin/
88+ ```
89+
90+ On Windows the archive is a ` .zip ` and PowerShell can read the manifest
91+ directly, so there is no text file to parse:
92+
93+ ``` powershell
94+ $version = 'v0.2.1'
95+ $target = 'x86_64-pc-windows-msvc'
96+
97+ $manifest = Invoke-RestMethod "https://cli.mapbox.com/$version/manifest.json"
98+ $artifact = $manifest.artifacts.$target
99+
100+ Invoke-WebRequest "https://cli.mapbox.com/$version/$($artifact.file)" -OutFile $artifact.file
101+ if ((Get-FileHash -Algorithm SHA256 $artifact.file).Hash -ine $artifact.sha256) {
102+ throw 'checksum mismatch'
103+ }
104+
105+ Expand-Archive $artifact.file -DestinationPath .
106+ ```
107+
108+ ` Invoke-WebRequest ` and ` Get-FileHash ` rather than ` curl ` and ` sha256sum ` :
109+ the first is an alias for something else in Windows PowerShell and neither of
110+ the others is guaranteed to be present.
111+
112+ Use ` latest ` in place of the version for whatever is current. Each archive
113+ holds one file, the ` mapbox ` executable, so there is no directory to step
114+ into and nothing else to place. ` ~/.local/bin ` is where the install script
115+ puts it too, and ` MAPBOX_INSTALL_DIR ` is the variable it reads if you prefer
116+ somewhere else.
117+
118+ The macOS builds are not code-signed with a Developer ID. ` curl ` attaches no
119+ quarantine flag, which is why the commands above run, but a download through
120+ a browser does, and Gatekeeper will refuse an unsigned binary that carries
121+ one. Clear it with ` xattr -d com.apple.quarantine mapbox ` .
122+
63123## Commands
64124
65125### Auth
0 commit comments