dotfiles/.chezmoiscripts/run_install_macchina.sh.tmpl

15 lines
871 B
Cheetah
Raw Normal View History

2023-10-10 20:22:26 +00:00
{{- if (lookPath "macchina" | not) -}}
#!/bin/bash
{{- if eq .chezmoi.os "darwin" }}
brew install macchina
{{- else if eq .chezmoi.os "linux" }}
2023-10-11 19:44:43 +00:00
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}mkdir -p /usr/local/bin
2023-10-10 20:22:26 +00:00
{{- if eq .chezmoi.arch "amd64" }}
2023-10-11 19:50:41 +00:00
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}curl -Lo /usr/local/bin/macchina https://github.com/Macchina-CLI/macchina/releases/download/{{ (gitHubLatestRelease "Macchina-CLI/macchina").TagName }}/macchina-linux-x86_64
2023-12-21 14:21:05 +00:00
{{- else if eq .chezmoi.arch "arm64" }}
2023-10-11 19:50:41 +00:00
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}curl -Lo /usr/local/bin/macchina https://github.com/Macchina-CLI/macchina/releases/download/{{ (gitHubLatestRelease "Macchina-CLI/macchina").TagName }}/macchina-linux-aarch64
2023-10-10 20:22:26 +00:00
{{- end }}
2023-10-11 19:50:41 +00:00
{{ if ne .chezmoi.uid "0" }} sudo {{ end -}}chmod +x /usr/local/bin/macchina
2023-10-10 20:22:26 +00:00
{{- end }}
{{- end }}