13 lines
441 B
Cheetah
13 lines
441 B
Cheetah
|
{{- if (lookPath "buf" | not) -}}
|
||
|
#!/bin/bash
|
||
|
|
||
|
{{- if eq .chezmoi.os "darwin" }}
|
||
|
brew install bufbuild/buf/buf
|
||
|
{{- else if eq .chezmoi.os "linux" }}
|
||
|
BIN="/usr/local/bin" && \
|
||
|
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}curl -sSL \
|
||
|
"https://github.com/bufbuild/buf/releases/latest/download//buf-$(uname -s)-$(uname -m)" \
|
||
|
-o "${BIN}/buf" && \
|
||
|
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}chmod +x "${BIN}/buf"
|
||
|
{{- end }}
|
||
|
{{- end }}
|