Skip to content

Commit 1dfe9cd

Browse files
authored
docs: simplify install instructions using variables (#3)
1 parent cc75887 commit 1dfe9cd

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

README.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,15 @@ Binaries are available for:
1919

2020
Download the binary for your platform from the [release page](https://github.com/kitproj/splunk-cli/releases).
2121

22-
#### Linux
23-
24-
**For Linux (amd64):**
2522
```bash
26-
sudo curl -fsL -o /usr/local/bin/splunk https://github.com/kitproj/splunk-cli/releases/download/v0.0.1/splunk_v0.0.1_linux_amd64
27-
sudo chmod +x /usr/local/bin/splunk
28-
```
23+
VERSION=v0.0.1
2924

30-
**For Linux (arm64):**
31-
```bash
32-
sudo curl -fsL -o /usr/local/bin/splunk https://github.com/kitproj/splunk-cli/releases/download/v0.0.1/splunk_v0.0.1_linux_arm64
33-
sudo chmod +x /usr/local/bin/splunk
34-
```
25+
PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')
3526

36-
#### macOS
27+
ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
3728

38-
**For macOS (Apple Silicon/arm64):**
39-
```bash
40-
sudo curl -fsL -o /usr/local/bin/splunk https://github.com/kitproj/splunk-cli/releases/download/v0.0.1/splunk_v0.0.1_darwin_arm64
41-
sudo chmod +x /usr/local/bin/splunk
42-
```
29+
sudo curl -fsL -o /usr/local/bin/splunk https://github.com/kitproj/splunk-cli/releases/download/${VERSION}/splunk_${VERSION}_${PLATFORM}_${ARCH}
4330

44-
**For macOS (Intel/amd64):**
45-
```bash
46-
sudo curl -fsL -o /usr/local/bin/splunk https://github.com/kitproj/splunk-cli/releases/download/v0.0.1/splunk_v0.0.1_darwin_amd64
4731
sudo chmod +x /usr/local/bin/splunk
4832
```
4933

0 commit comments

Comments
 (0)