Repository navigation
Commit 09e488f
scripts/helm-docs.sh: detect CPU architecture on every OS (#952)
`scripts/helm-docs.sh` hardcoded `arch=x86_64` on macOS, so on Apple
Silicon it downloads an amd64 binary and fails:
```
target/bin/helm-docs-1.7.0: Bad CPU type in executable
```
Two more latent bugs in the same block: the Linux `amd64` branch pointed
at `helm-docs_1.7.0_linux_amd64.tar.gz`, which is not a published asset
(they are `x86_64`), and Linux arm64 hosts report `aarch64` from `uname
-m`, which the `arm)` branch never matched.
This replaces the per-OS blocks with one `uname -s` case for the OS and
one `uname -m` case for the architecture, mapped to the [release asset
names](https://github.com/norwoodj/helm-docs/releases/tag/v1.7.0)
(`Darwin_arm64`, `Linux_x86_64`, ...). Unsupported combinations exit 126
with the offending value instead of a generic message. The pinned
version stays at 1.7.0 so generated READMEs do not churn.
## Test plan
- On an M-series Mac: `rm -rf target && ./scripts/helm-docs.sh`
downloads `Mach-O 64-bit executable arm64` and regenerates all four
chart READMEs with no diff (the `AGENTS.md` check).
- `curl -I` confirms `Darwin_x86_64`, `Darwin_arm64`, `Linux_x86_64`,
`Linux_arm64` assets exist for v1.7.0 and `linux_amd64` returns 404.
Co-authored-by: Amp <amp@ampcode.com>1 parent 1248d79 commit 09e488f
1 file changed
Lines changed: 14 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
40 | 26 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 27 | | |
47 | 28 | | |
48 | 29 | | |
| |||
0 commit comments