Skip to content

Commit 1ff7780

Browse files
rgee0alexellis
authored andcommitted
feat: add git-who to tools
Signed-off-by: Richard Gee <[email protected]>
1 parent 6b3a4c6 commit 1ff7780

File tree

3 files changed

+89
-13
lines changed

3 files changed

+89
-13
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ There are 52 apps that you can install on your cluster.
791791
| [dive](https://github.com/wagoodman/dive) | A tool for exploring each layer in a docker image |
792792
| [docker-compose](https://github.com/docker/compose) | Define and run multi-container applications with Docker. |
793793
| [doctl](https://github.com/digitalocean/doctl) | Official command line interface for the DigitalOcean API. |
794-
| [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | Dotenv-linter is a lightning-fast linter for .env files. Written in Rust. |
794+
| [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | A lightning-fast linter for .env files. |
795795
| [duplik8s](https://github.com/Telemaco019/duplik8s) | kubectl plugin to duplicate resources in a Kubernetes cluster. |
796796
| [eks-node-viewer](https://github.com/awslabs/eks-node-viewer) | eks-node-viewer is a tool for visualizing dynamic node usage within an EKS cluster. |
797797
| [eksctl](https://github.com/eksctl-io/eksctl) | Amazon EKS Kubernetes cluster management |
@@ -805,6 +805,7 @@ There are 52 apps that you can install on your cluster.
805805
| [fstail](https://github.com/alexellis/fstail) | Tail modified files in a directory. |
806806
| [fzf](https://github.com/junegunn/fzf) | General-purpose command-line fuzzy finder |
807807
| [gh](https://github.com/cli/cli) | GitHub’s official command line tool. |
808+
| [git-who](https://github.com/sinclairtarget/git-who) | Git blame for file trees. |
808809
| [glab](https://github.com/gitlab-org/cli) | A GitLab CLI tool bringing GitLab to your command line. |
809810
| [golangci-lint](https://github.com/golangci/golangci-lint) | Go linters aggregator. |
810811
| [gomplate](https://github.com/hairyhenderson/gomplate) | A flexible commandline tool for template rendering. Supports lots of local and remote datasources. |
@@ -873,6 +874,7 @@ There are 52 apps that you can install on your cluster.
873874
| [nats](https://github.com/nats-io/natscli) | Utility to interact with and manage NATS. |
874875
| [nats-server](https://github.com/nats-io/nats-server) | Cloud native message bus and queue server |
875876
| [nerdctl](https://github.com/containerd/nerdctl) | Docker-compatible CLI for containerd, with support for Compose |
877+
| [node_exporter](https://github.com/prometheus/node_exporter) | Prometheus exporter for monitoring server metrics |
876878
| [nova](https://github.com/FairwindsOps/nova) | Find outdated or deprecated Helm charts running in your cluster. |
877879
| [oc](https://github.com/openshift/oc) | Client to use an OpenShift 4.x cluster. |
878880
| [oh-my-posh](https://github.com/jandedobbeleer/oh-my-posh) | A prompt theme engine for any shell that can display kubernetes information. |
@@ -923,6 +925,5 @@ There are 52 apps that you can install on your cluster.
923925
| [waypoint](https://github.com/hashicorp/waypoint) | Easy application deployment for Kubernetes and Amazon ECS |
924926
| [yq](https://github.com/mikefarah/yq) | Portable command-line YAML processor. |
925927
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Fork of youtube-dl with additional features and fixes |
926-
There are 163 tools, use `arkade get NAME` to download one.
927-
928+
There are 166 tools, use `arkade get NAME` to download one.
928929
> Note to contributors, run `go build && ./arkade get --format markdown` to generate this list

pkg/get/get_test.go

+58-8
Original file line numberDiff line numberDiff line change
@@ -4329,7 +4329,7 @@ func Test_DownloadCaddy(t *testing.T) {
43294329
func Test_DownloadNatsServer(t *testing.T) {
43304330
tools := MakeTools()
43314331
name := "nats-server"
4332-
version := "v2.7.4"
4332+
version := "v2.11.0"
43334333

43344334
tool := getTool(name, tools)
43354335

@@ -4338,37 +4338,37 @@ func Test_DownloadNatsServer(t *testing.T) {
43384338
os: "darwin",
43394339
arch: arch64bit,
43404340
version: version,
4341-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-darwin-amd64.zip`,
4341+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-darwin-amd64.tar.gz`,
43424342
},
43434343
{
43444344
os: "darwin",
43454345
arch: archDarwinARM64,
43464346
version: version,
4347-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-darwin-arm64.zip`,
4347+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-darwin-arm64.tar.gz`,
43484348
},
43494349
{
43504350
os: "linux",
43514351
arch: arch64bit,
43524352
version: version,
4353-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-linux-amd64.zip`,
4353+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-linux-amd64.tar.gz`,
43544354
},
43554355
{
43564356
os: "linux",
43574357
arch: archARM64,
43584358
version: version,
4359-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-linux-arm64.zip`,
4359+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-linux-arm64.tar.gz`,
43604360
},
43614361
{
43624362
os: "linux",
43634363
arch: archARM7,
43644364
version: version,
4365-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-linux-arm7.zip`,
4365+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-linux-arm7.tar.gz`,
43664366
},
43674367
{
43684368
os: "ming",
43694369
arch: arch64bit,
43704370
version: version,
4371-
url: `https://github.com/nats-io/nats-server/releases/download/v2.7.4/nats-server-v2.7.4-windows-amd64.zip`,
4371+
url: `https://github.com/nats-io/nats-server/releases/download/v2.11.0/nats-server-v2.11.0-windows-amd64.zip`,
43724372
},
43734373
}
43744374

@@ -8347,7 +8347,57 @@ func Test_DownloadDotenvLinter(t *testing.T) {
83478347
t.Fatal(err)
83488348
}
83498349
if got != tc.url {
8350-
t.Errorf("want: %s, got: %s", tc.url, got)
8350+
t.Errorf("\nwant: %s\ngot: %s", tc.url, got)
8351+
}
8352+
}
8353+
}
8354+
8355+
func Test_Download_gitwho(t *testing.T) {
8356+
tools := MakeTools()
8357+
name := "git-who"
8358+
const toolVersion = "v0.6"
8359+
8360+
tool := getTool(name, tools)
8361+
8362+
tests := []test{
8363+
{
8364+
os: "darwin",
8365+
arch: arch64bit,
8366+
version: toolVersion,
8367+
url: "https://github.com/sinclairtarget/git-who/releases/download/v0.6/gitwho_v0.6_darwin_amd64.tar.gz",
8368+
},
8369+
{
8370+
os: "darwin",
8371+
arch: archDarwinARM64,
8372+
version: toolVersion,
8373+
url: "https://github.com/sinclairtarget/git-who/releases/download/v0.6/gitwho_v0.6_darwin_arm64.tar.gz",
8374+
},
8375+
{
8376+
os: "linux",
8377+
arch: arch64bit,
8378+
version: toolVersion,
8379+
url: "https://github.com/sinclairtarget/git-who/releases/download/v0.6/gitwho_v0.6_linux_amd64.tar.gz",
8380+
},
8381+
{
8382+
os: "linux",
8383+
arch: archARM64,
8384+
version: toolVersion,
8385+
url: "https://github.com/sinclairtarget/git-who/releases/download/v0.6/gitwho_v0.6_linux_arm64.tar.gz",
8386+
},
8387+
{
8388+
os: "linux",
8389+
arch: archARM7,
8390+
version: toolVersion,
8391+
url: "https://github.com/sinclairtarget/git-who/releases/download/v0.6/gitwho_v0.6_linux_arm.tar.gz",
8392+
},
8393+
}
8394+
for _, tc := range tests {
8395+
got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
8396+
if err != nil {
8397+
t.Fatal(err)
8398+
}
8399+
if got != tc.url {
8400+
t.Fatalf("\nwant: %s\ngot: %s", tc.url, got)
83518401
}
83528402
}
83538403
}

pkg/get/tools.go

+27-2
Original file line numberDiff line numberDiff line change
@@ -2527,9 +2527,11 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
25272527
BinaryTemplate: `
25282528
{{ $archStr := "" }}
25292529
{{ $osStr := "linux" }}
2530+
{{ $ext := "tar.gz" }}
25302531
25312532
{{ if HasPrefix .OS "ming" -}}
25322533
{{ $osStr = "windows" }}
2534+
{{ $ext = "zip" }}
25332535
{{- else if eq .OS "darwin" -}}
25342536
{{ $osStr = "darwin" }}
25352537
{{- end -}}
@@ -2544,7 +2546,7 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
25442546
{{ $archStr = "arm7" }}
25452547
{{- end -}}
25462548
2547-
{{ .Name }}-{{ .Version }}-{{ $osStr }}-{{ $archStr }}.zip
2549+
{{ .Name }}-{{ .Version }}-{{ $osStr }}-{{ $archStr }}.{{$ext}}
25482550
`,
25492551
})
25502552

@@ -4570,9 +4572,32 @@ https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`,
45704572
{{$ext = "zip"}}
45714573
{{- end -}}
45724574
4573-
dotenv-linter-{{$os}}-{{$arch}}.{{$ext}}
4575+
{{.Name}}-{{$os}}-{{$arch}}.{{$ext}}
45744576
`,
45754577
})
4578+
tools = append(tools,
4579+
Tool{
4580+
Owner: "sinclairtarget",
4581+
Repo: "git-who",
4582+
Name: "git-who",
4583+
VersionStrategy: GitHubVersionStrategy,
4584+
Description: "Git blame for file trees.",
4585+
BinaryTemplate: `
4586+
{{$os := .OS}}
4587+
{{$arch := .Arch}}
4588+
{{$ext := "tar.gz"}}
4589+
4590+
{{- if eq .Arch "x86_64" -}}
4591+
{{$arch = "amd64"}}
4592+
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
4593+
{{$arch = "arm64"}}
4594+
{{- else if eq .Arch "armv7l" -}}
4595+
{{$arch = "arm"}}
4596+
{{- end -}}
4597+
4598+
gitwho_{{.Version}}_{{$os}}_{{$arch}}.{{$ext}}
4599+
`,
4600+
})
45764601

45774602
return tools
45784603
}

0 commit comments

Comments
 (0)