dotfiles/.chezmoiscripts/run_install_go.sh.tmpl

8 lines
472 B
Cheetah
Raw Normal View History

2023-10-10 20:22:26 +00:00
{{- if (lookPath "go" | not) -}}
#!/bin/bash
{{- if eq .chezmoi.os "darwin" }}
brew install go
{{- else if eq .chezmoi.os "linux" }}
2023-10-10 20:26:15 +00:00
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}rm -rf /usr/local/go || {{ if ne .chezmoi.uid "0" }} sudo {{ end -}}mkdir -p /usr/local/go && curl -L https://go.dev/dl/{{ (gitHubLatestTag "golang/go").Tag }}.linux-{{ .chezmoi.arch }}.tar.gz | {{ if ne .chezmoi.uid "0" }} sudo {{ end -}}tar -xz -C /usr/local/
2023-10-10 20:22:26 +00:00
{{- end }}
{{- end }}