install.fairie/home/.chezmoiscripts/universal/run_onchange_before_09-install-go.tmpl
Brian Zalewski 655009acb5 Update 8 files
- /home/.chezmoiscripts/universal/run_onchange_before_05-install-homebrew.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-ensure-node-version.tmpl
- /home/.chezmoitemplates/universal/common-dependencies
- /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_09-install-go.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl
- /home/.chezmoiscripts/_universal/run_onchange_before_05-install-homebrew.tmpl
2023-02-04 04:53:29 +00:00

22 lines
593 B
Cheetah

{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure Go is installed
if ! command -v go > /dev/null; then
if command -v brew; then
logg 'Installing `go` via Homebrew'
brew install go || GO_EXIT_CODE=$?
if [ -n "$GO_EXIT_CODE" ]; then
logg error '`go` was not successfully installed via Homebrew'
fi
else
logg '`brew` is unavailable. Cannot use it to perform a system installation of node.'
fi
else
logg '`go` is available'
fi
{{ end -}}