Fixes ASDF completion symlink and adds GH CLI
This commit is contained in:
parent
be45dcdaf8
commit
523ead0cc4
3 changed files with 31 additions and 1 deletions
|
@ -0,0 +1,28 @@
|
||||||
|
{{- if (ne .host.distro.family "windows") -}}
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# @file GH (GitHub CLI) Install
|
||||||
|
# @brief Ensures GH (the GitHub CLI) is installed via Homebrew
|
||||||
|
# @description
|
||||||
|
# This script installs GH via Homebrew. GH is included as a dependency for
|
||||||
|
# generating the global git config helper since GH provides a credential
|
||||||
|
# helper that can be used to authenticate calls on `github.com`.
|
||||||
|
|
||||||
|
{{ includeTemplate "universal/profile-before" }}
|
||||||
|
{{ includeTemplate "universal/logg-before" }}
|
||||||
|
|
||||||
|
### Ensure gh is installed
|
||||||
|
if ! command -v gh > /dev/null; then
|
||||||
|
if command -v brew; then
|
||||||
|
logg 'Installing gh via Homebrew'
|
||||||
|
brew install gh || GH_EXIT_CODE=$?
|
||||||
|
if [ -n "$GH_EXIT_CODE" ]; then
|
||||||
|
logg error 'gh 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 'gh is available'
|
||||||
|
fi
|
||||||
|
|
||||||
|
{{ end -}}
|
|
@ -62,10 +62,12 @@
|
||||||
[credential]
|
[credential]
|
||||||
helper = cache --timeout=3600
|
helper = cache --timeout=3600
|
||||||
credentialStore = {{ if eq .host.distro.id "darwin" }}keychain{{ else }}{{ if eq .host.distro.id "windows" }}wincredman{{ else }}secretservice{{ end }}{{ end }}
|
credentialStore = {{ if eq .host.distro.id "darwin" }}keychain{{ else }}{{ if eq .host.distro.id "windows" }}wincredman{{ else }}secretservice{{ end }}{{ end }}
|
||||||
|
{{ if (lookPath "asdf") -}}
|
||||||
[credential "https://github.com"]
|
[credential "https://github.com"]
|
||||||
helper = !{{- output "which" "gh" | trim }} auth git-credential
|
helper = !{{- output "which" "gh" | trim }} auth git-credential
|
||||||
[credential "https://gist.github.com"]
|
[credential "https://gist.github.com"]
|
||||||
helper = !{{- output "which" "gh" | trim }} auth git-credential
|
helper = !{{- output "which" "gh" | trim }} auth git-credential
|
||||||
|
{{- end -}}
|
||||||
[delta]
|
[delta]
|
||||||
features = Betelgeuse
|
features = Betelgeuse
|
||||||
[delta "Betelgeuse"]
|
[delta "Betelgeuse"]
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{{- if (lookPath "asdf") -}}
|
{{- if (lookPath "asdf") -}}
|
||||||
{{- output "echo" "${XDG_DATA_HOME:-$HOME/.local/share}/asdf/completions/_asdf" -}}
|
{{ .host.home }}/.local/share/asdf/completions/_asdf
|
||||||
{{- end -}}
|
{{- end -}}
|
Loading…
Reference in a new issue