dotfiles/.chezmoiscripts/run_install_buf.sh.tmpl

13 lines
441 B
Cheetah
Raw Normal View History

2023-10-10 20:22:26 +00:00
{{- 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 }}