dotfiles/.chezmoiscripts/run_install_go.sh.tmpl

8 lines
484 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-11 06:28:12 +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/$(curl "https://go.dev/VERSION?m=text" | head -n 1).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 }}