Fish Shell with UBI and Tag Helpers
This example configures Fish shell with platform-specific logic, uses snippets to simplify installations, and includes link actions based on feature tags like +eza
or +bat
.
Highlights
- Reusable Snippets: Uses
{{ snippet ubi }}
for binary installation. - Platform Detection: Different install steps for Linux vs. macOS.
- Tag-Controlled Links: Links functions based on tool presence (
+ripgrep
,+bat
).
[[install]]
name = "fish"
check = "command -v fish"
install = """{{ snippet ubi }}
if [ ! -f \"/usr/local/bin/fish\" ]; then
sudo cp $HOME/.local/bin/fish /usr/local/bin/fish
fi
fish --install < {{ dir.this_dir }}/confirm.txt
"""
requires = ["+os=linux"]
variables = { exe = "fish", url = "https://github.com/fish-shell/fish-shell/releases/download/4.0.2/fish-static-{{ tag.arch_alias }}-4.0.2.tar.xz" }
[[install]]
name = "fish"
check = "command -v fish"
install = "brew install fish"
requires = ["+os=macos"]
[[link]]
source = "functions/egrep.fish"
target = "~/.config/fish/functions/egrep.fish"
requires = ["+ripgrep"]
[[link]]
source = "functions/cat.fish"
target = "~/.config/fish/functions/cat.fish"
requires = ["+bat"]