Files
omarchy/.chezmoiscripts/run_onchange_after_20-gh-extensions.sh.tmpl
T
Prad Nukala b18729f4a0 Initial import: chezmoi source for Omarchy (Hyprland)
Imported from prdlk/dotfiles master (efdd827), which supersedes the omarchy
branch (3031416). Drops the Umbriel, Noctalia, niri, CachyOS, macOS, and Blume
docs-site layers; docs/ is plain Markdown.
2026-11-02 09:14:11 -05:00

26 lines
974 B
Cheetah

#!/usr/bin/env fish
# Install gh extensions declared in .chezmoidata/packages.yaml.
# A fish script, so fish's config (~/.config/fish, applied before after-scripts
# run) is sourced first: PATH (mise, ~/.local/bin, ~/.cargo/bin) and
# GITHUB_TOKEN (conf.d/10-env.fish) match a fish session.
# gh_extensions hash: {{ .packages.shared.gh_extensions | toJson | sha256sum }}
if not command -q gh
echo "warning: gh not installed — skipping extensions" >&2
exit 0
end
if not gh auth status >/dev/null 2>&1
echo "warning: gh not authenticated — run 'gh auth login', then 'chezmoi apply' again" >&2
exit 0
end
set -l installed (gh extension list 2>/dev/null | string split -f2 \t)
set -l failed
for ext in{{ range .packages.shared.gh_extensions }} {{ . | quote }}{{ end }}
contains -- $ext $installed; or gh extension install $ext; or set -a failed $ext
end
if set -q failed[1]
echo "error: gh extension install failed for: $failed" >&2
exit 1
end