Compare commits
13 Commits
a70e88c344
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e766b3326 | |||
|
a7510cc8ea
|
|||
|
a351e62a17
|
|||
|
7936a0966e
|
|||
|
fee2d99bea
|
|||
|
7d4e33bc7e
|
|||
|
782ef833c2
|
|||
|
8917442089
|
|||
|
8d9e7ae43f
|
|||
|
9e7539d863
|
|||
|
6fd1e3221e
|
|||
|
df7c921bc6
|
|||
|
abbbf20b40
|
@@ -254,7 +254,10 @@ rm -f file.txt # Falls through to standard rm -f
|
|||||||
| `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) |
|
| `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) |
|
||||||
| `check_fish_deps` | Legacy alias — delegates to `fish-deps status` |
|
| `check_fish_deps` | Legacy alias — delegates to `fish-deps status` |
|
||||||
|
|
||||||
Install method priority: **cargo** (for Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose.
|
Install method priority: **git+cargo source build** (fish) → **cargo** (other Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Upgrading Fish from source requires **cargo** and **[uv](https://docs.astral.sh/uv/)**. Both are managed dependencies — `fish-deps install` will offer to install them before attempting the Fish build. If both are unavailable, `fish-deps update` falls back to the system package manager.
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
@@ -491,19 +494,26 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
|
|||||||
|
|
||||||
### Required
|
### Required
|
||||||
|
|
||||||
| Tool | Purpose |
|
| Tool | Version | Purpose |
|
||||||
|---|---|
|
|---|---|---|
|
||||||
| [Fish](https://fishshell.com/) | Shell |
|
| [uv](https://docs.astral.sh/uv/) | any | Python runner (needed to build Fish from source) |
|
||||||
| [Fisher](https://github.com/jorgebucaran/fisher) | Plugin manager |
|
| [Rust / cargo](https://www.rust-lang.org/tools/install) | any | Installs Rust-based tools; required to build Fish |
|
||||||
| [Starship](https://starship.rs/) | Prompt |
|
| [Fish](https://fishshell.com/) | **≥ 4.0** | Shell |
|
||||||
| [fzf](https://github.com/junegunn/fzf) | Fuzzy finder |
|
| [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager |
|
||||||
| [zoxide](https://github.com/ajeetdsouza/zoxide) | Smart directory jumper |
|
| [Starship](https://starship.rs/) | any | Prompt |
|
||||||
| [direnv](https://direnv.net/) | Per-directory env loading |
|
| [fzf](https://github.com/junegunn/fzf) | any | Fuzzy finder |
|
||||||
|
| [zoxide](https://github.com/ajeetdsouza/zoxide) | any | Smart directory jumper |
|
||||||
|
| [direnv](https://direnv.net/) | any | Per-directory env loading |
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Fish **4.0 or newer is required.** This config uses `test` syntax and other constructs that are incompatible with Fish 3.x. Older versions will produce errors on startup.
|
||||||
|
> Run `fish-deps install` or `fish-deps update` to upgrade — it will install `uv` and `cargo` automatically if missing, then build the latest Fish from source.
|
||||||
|
|
||||||
### Recommended
|
### Recommended
|
||||||
|
|
||||||
| Tool | Replaces |
|
| Tool | Replaces |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
| [Rust / cargo](https://www.rust-lang.org/tools/install) | Build tool for Rust-based CLI replacements below |
|
||||||
| [paru](https://github.com/Morganamilo/paru) / [yay](https://github.com/Jguer/yay) | AUR helper (Arch only) |
|
| [paru](https://github.com/Morganamilo/paru) / [yay](https://github.com/Jguer/yay) | AUR helper (Arch only) |
|
||||||
| [eza](https://github.com/eza-community/eza) | `ls` (preferred) |
|
| [eza](https://github.com/eza-community/eza) | `ls` (preferred) |
|
||||||
| [lsd](https://github.com/lsd-rs/lsd) | `ls` (fallback) |
|
| [lsd](https://github.com/lsd-rs/lsd) | `ls` (fallback) |
|
||||||
|
|||||||
@@ -2,40 +2,43 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
# Populates parallel arrays describing every managed dependency.
|
# Populates parallel arrays describing every managed dependency.
|
||||||
# Callers must invoke this function before accessing _fdc_* variables.
|
# Callers must invoke this function before accessing _fdc_* arrays.
|
||||||
#
|
#
|
||||||
# Array layout (same index across all sets):
|
# Array layout (same index across all sets):
|
||||||
# _fdc_bins — binary name (what `type -q` checks)
|
# _fdc_bins — binary name (what `type -q` checks)
|
||||||
# _fdc_tiers — req | int | rec
|
# _fdc_tiers — req | int | rec
|
||||||
# _fdc_cargo — cargo crate name, or "" if not on crates.io
|
# _fdc_cargo — cargo crate name, or "" if not on crates.io
|
||||||
# _fdc_pm — system PM package name, or "" if not in repos
|
# _fdc_pm — system PM package name, or "" if not in repos
|
||||||
# _fdc_special — special install key: fisher-bootstrap | fzf-update |
|
# _fdc_special — special install key: rustup-installer | fisher-bootstrap |
|
||||||
# pipx | curl-installer | "" (none)
|
# fzf-update | paru-build | pipx | curl-installer |
|
||||||
|
# git-cargo-fish | curl-uv | "" (none)
|
||||||
|
#
|
||||||
|
# uv and cargo are listed first so both are available before fish and other Rust tools.
|
||||||
function _fish_deps_catalog
|
function _fish_deps_catalog
|
||||||
set -g _fdc_bins \
|
set -g _fdc_bins \
|
||||||
fish fisher starship fzf zoxide direnv paru \
|
uv cargo fish fisher starship fzf zoxide direnv paru \
|
||||||
wakatime tailscale \
|
wakatime tailscale \
|
||||||
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
||||||
|
|
||||||
set -g _fdc_tiers \
|
set -g _fdc_tiers \
|
||||||
req req req req req req rec \
|
req req req req req req req req rec \
|
||||||
int int \
|
int int \
|
||||||
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
||||||
|
|
||||||
set -g _fdc_cargo \
|
set -g _fdc_cargo \
|
||||||
"" "" starship "" zoxide "" "" \
|
"" "" "" "" starship "" zoxide "" "" \
|
||||||
"" "" \
|
"" "" \
|
||||||
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trash-cli "" ""
|
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" ""
|
||||||
|
|
||||||
set -g _fdc_pm \
|
set -g _fdc_pm \
|
||||||
fish "" starship fzf zoxide direnv "" \
|
uv cargo fish "" starship fzf zoxide direnv "" \
|
||||||
wakatime tailscale \
|
wakatime tailscale \
|
||||||
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
||||||
|
|
||||||
set -g _fdc_special \
|
set -g _fdc_special \
|
||||||
"" fisher-bootstrap curl-installer fzf-update "" "" "" \
|
curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build \
|
||||||
pipx "" \
|
wakatime-binary "" \
|
||||||
"" "" "" "" "" "" "" "" "" "" "" "" "" ""
|
"" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" ""
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found.
|
# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found.
|
||||||
|
|||||||
@@ -11,7 +11,20 @@ function _fish_deps_install
|
|||||||
|
|
||||||
set -l i 1
|
set -l i 1
|
||||||
for bin in $_fdc_bins
|
for bin in $_fdc_bins
|
||||||
|
# Determine if this dep needs attention: missing, or fish < 4.0
|
||||||
|
set -l needs_install 0
|
||||||
|
set -l upgrade_label Install
|
||||||
if not type -q $bin
|
if not type -q $bin
|
||||||
|
set needs_install 1
|
||||||
|
else if test "$bin" = fish
|
||||||
|
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
|
||||||
|
if test -n "$_major"; and test "$_major" -lt 4
|
||||||
|
set needs_install 1
|
||||||
|
set upgrade_label "Upgrade"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if test $needs_install -eq 1
|
||||||
set -l cargo_crate $_fdc_cargo[$i]
|
set -l cargo_crate $_fdc_cargo[$i]
|
||||||
set -l pm_pkg $_fdc_pm[$i]
|
set -l pm_pkg $_fdc_pm[$i]
|
||||||
set -l special $_fdc_special[$i]
|
set -l special $_fdc_special[$i]
|
||||||
@@ -20,25 +33,53 @@ function _fish_deps_install
|
|||||||
set -l methods
|
set -l methods
|
||||||
set -l method_labels
|
set -l method_labels
|
||||||
|
|
||||||
# Cargo first — preferred for Rust tools; gets the latest crate version
|
# Cargo — preferred for Rust tools; gets the latest crate version
|
||||||
if test -n "$cargo_crate"
|
if test -n "$cargo_crate"
|
||||||
if type -q cargo
|
if type -q cargo
|
||||||
set -a methods cargo
|
set -a methods cargo
|
||||||
set -a method_labels "cargo ($cargo_crate)"
|
set -a method_labels "cargo ($cargo_crate)"
|
||||||
else
|
else
|
||||||
set_color brblack
|
set_color brblack
|
||||||
echo " note: cargo not found — install rustup for the latest $bin"
|
echo " note: cargo not found — install cargo first for the latest $bin"
|
||||||
set_color normal
|
set_color normal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# System PM — after cargo so cargo is always the default when available
|
# Preferred special methods — listed before system PM so they are the default
|
||||||
|
switch $special
|
||||||
|
case curl-uv
|
||||||
|
set -a methods special-uv
|
||||||
|
set -a method_labels "curl installer (official script)"
|
||||||
|
case git-cargo-fish
|
||||||
|
if type -q cargo; and type -q uv
|
||||||
|
set -a methods special-git-cargo-fish
|
||||||
|
set -a method_labels "build from source (git + cargo)"
|
||||||
|
else
|
||||||
|
set_color brblack
|
||||||
|
set -l _need
|
||||||
|
type -q cargo; or set -a _need cargo
|
||||||
|
type -q uv; or set -a _need uv
|
||||||
|
echo " note: "(string join " and " $_need)" not found — install them first to build fish from source"
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
|
case rustup-installer
|
||||||
|
set -a methods special-rustup
|
||||||
|
set -a method_labels "rustup installer (curl | sh)"
|
||||||
|
case curl-lazydocker
|
||||||
|
set -a methods special-lazydocker
|
||||||
|
set -a method_labels "curl installer (official script)"
|
||||||
|
case wakatime-binary
|
||||||
|
set -a methods special-wakatime
|
||||||
|
set -a method_labels "binary download (github releases)"
|
||||||
|
end
|
||||||
|
|
||||||
|
# System PM — after cargo and preferred specials
|
||||||
if test -n "$pm_pkg"; and test -n "$pm"
|
if test -n "$pm_pkg"; and test -n "$pm"
|
||||||
set -a methods pm
|
set -a methods pm
|
||||||
set -a method_labels "$pm ($pm_pkg)"
|
set -a method_labels "$pm ($pm_pkg)"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Special methods
|
# Supplemental special methods (fallbacks, Arch-only, etc.)
|
||||||
switch $special
|
switch $special
|
||||||
case fzf-update
|
case fzf-update
|
||||||
set -a methods special-fzf
|
set -a methods special-fzf
|
||||||
@@ -49,6 +90,16 @@ function _fish_deps_install
|
|||||||
case curl-installer
|
case curl-installer
|
||||||
set -a methods special-curl
|
set -a methods special-curl
|
||||||
set -a method_labels "curl installer"
|
set -a method_labels "curl installer"
|
||||||
|
case paru-build
|
||||||
|
# Only offered on Arch-based systems where pacman is present
|
||||||
|
if type -q yay
|
||||||
|
set -a methods special-yay-paru
|
||||||
|
set -a method_labels "yay -S paru"
|
||||||
|
end
|
||||||
|
if type -q pacman
|
||||||
|
set -a methods special-paru
|
||||||
|
set -a method_labels "build from AUR (makepkg)"
|
||||||
|
end
|
||||||
case pipx
|
case pipx
|
||||||
if type -q pipx
|
if type -q pipx
|
||||||
set -a methods special-pipx
|
set -a methods special-pipx
|
||||||
@@ -67,8 +118,8 @@ function _fish_deps_install
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
# Prompt: install this dep?
|
# Prompt: install/upgrade this dep?
|
||||||
read -l -P (set_color cyan)"Install $bin?"(set_color normal)" [Y/n] " _reply
|
read -l -P (set_color cyan)"$upgrade_label $bin?"(set_color normal)" [Y/n] " _reply
|
||||||
if test "$_reply" = n; or test "$_reply" = N
|
if test "$_reply" = n; or test "$_reply" = N
|
||||||
set i (math $i + 1)
|
set i (math $i + 1)
|
||||||
continue
|
continue
|
||||||
@@ -85,11 +136,11 @@ function _fish_deps_install
|
|||||||
set m (math $m + 1)
|
set m (math $m + 1)
|
||||||
end
|
end
|
||||||
read -l -P " Choose [1-"(count $methods)"] (default 1 = $method_labels[1]): " _choice
|
read -l -P " Choose [1-"(count $methods)"] (default 1 = $method_labels[1]): " _choice
|
||||||
if test -n "$_choice"; and test "$_choice" -ge 1; and test "$_choice" -le (count $methods)
|
if string match -qr '^\d+$' "$_choice"; and test "$_choice" -ge 1; and test "$_choice" -le (count $methods)
|
||||||
set chosen_method $methods[$_choice]
|
set chosen_method $methods[$_choice]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
set_color brblack; echo " Installing via $method_labels[1]"; set_color normal
|
set_color brblack; echo " "(string lower $upgrade_label)"ing via $method_labels[1]"; set_color normal
|
||||||
end
|
end
|
||||||
|
|
||||||
# Execute chosen method
|
# Execute chosen method
|
||||||
@@ -98,6 +149,48 @@ function _fish_deps_install
|
|||||||
cargo install $cargo_crate
|
cargo install $cargo_crate
|
||||||
case pm
|
case pm
|
||||||
_fish_deps_pm_install $pm_pkg
|
_fish_deps_pm_install $pm_pkg
|
||||||
|
case special-rustup
|
||||||
|
curl https://sh.rustup.rs -sSf | sh
|
||||||
|
# Add cargo to PATH for the rest of this session without restarting.
|
||||||
|
# Try CARGO_HOME first (set in config.fish), then the rustup default.
|
||||||
|
for _d in "$CARGO_HOME/bin" "$HOME/.cargo/bin"
|
||||||
|
if test -d "$_d"
|
||||||
|
fish_add_path "$_d"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not type -q cargo
|
||||||
|
set_color yellow
|
||||||
|
echo " cargo not yet in PATH — restart your shell if subsequent installs fail."
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
|
case special-lazydocker
|
||||||
|
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
|
||||||
|
case special-wakatime
|
||||||
|
set -l _arch (uname -m)
|
||||||
|
switch $_arch
|
||||||
|
case x86_64
|
||||||
|
set _arch amd64
|
||||||
|
case aarch64 arm64
|
||||||
|
set _arch arm64
|
||||||
|
case armv7l
|
||||||
|
set _arch arm
|
||||||
|
case '*'
|
||||||
|
set _arch amd64
|
||||||
|
end
|
||||||
|
set -l _zip "wakatime-cli-linux-$_arch.zip"
|
||||||
|
set -l _bin_src "wakatime-cli-linux-$_arch"
|
||||||
|
set -l _wt_dir "$HOME/.config/wakatime"
|
||||||
|
set -l _wt_bin "$_wt_dir/wakatime"
|
||||||
|
set -l _tmpdir (mktemp -d)
|
||||||
|
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
|
||||||
|
-o "$_tmpdir/$_zip"
|
||||||
|
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||||
|
and mkdir -p "$_wt_dir" "$HOME/.local/bin"
|
||||||
|
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
|
||||||
|
and chmod +x "$_wt_bin"
|
||||||
|
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
|
||||||
|
rm -rf "$_tmpdir"
|
||||||
case special-fzf
|
case special-fzf
|
||||||
fzf-update
|
fzf-update
|
||||||
case special-fisher
|
case special-fisher
|
||||||
@@ -107,6 +200,44 @@ function _fish_deps_install
|
|||||||
if test "$bin" = starship
|
if test "$bin" = starship
|
||||||
curl -sS https://starship.rs/install.sh | sh
|
curl -sS https://starship.rs/install.sh | sh
|
||||||
end
|
end
|
||||||
|
case special-yay-paru
|
||||||
|
yay -S --noconfirm paru
|
||||||
|
case special-paru
|
||||||
|
set -l _build_dir (mktemp -d)
|
||||||
|
git clone https://aur.archlinux.org/paru.git $_build_dir
|
||||||
|
and pushd $_build_dir
|
||||||
|
and makepkg -si --noconfirm
|
||||||
|
and popd
|
||||||
|
rm -rf $_build_dir
|
||||||
|
case special-uv
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
# Add uv to PATH for the rest of this session
|
||||||
|
for _d in "$HOME/.local/bin" "$HOME/.cargo/bin"
|
||||||
|
if test -d "$_d"
|
||||||
|
fish_add_path "$_d"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not type -q uv
|
||||||
|
set_color yellow
|
||||||
|
echo " uv not yet in PATH — restart your shell if subsequent installs fail."
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
|
case special-git-cargo-fish
|
||||||
|
set -l _tmpdir (mktemp -d)
|
||||||
|
set -l _build_ok 0
|
||||||
|
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
|
||||||
|
and begin
|
||||||
|
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
|
||||||
|
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
|
||||||
|
true
|
||||||
|
end
|
||||||
|
and pushd "$_tmpdir"
|
||||||
|
and uv run --no-managed-python cargo install --path .
|
||||||
|
and set _build_ok 1
|
||||||
|
popd 2>/dev/null
|
||||||
|
rm -rf "$_tmpdir"
|
||||||
|
test $_build_ok -eq 1
|
||||||
case special-pipx
|
case special-pipx
|
||||||
pipx install $bin
|
pipx install $bin
|
||||||
case special-pip
|
case special-pip
|
||||||
@@ -115,9 +246,14 @@ function _fish_deps_install
|
|||||||
|
|
||||||
if test $status -eq 0
|
if test $status -eq 0
|
||||||
set installed_any 1
|
set installed_any 1
|
||||||
set_color green; echo " $bin installed."; set_color normal
|
set_color green; echo " $bin "(string lower $upgrade_label)"ed."; set_color normal
|
||||||
|
if test "$bin" = fish
|
||||||
|
set_color yellow
|
||||||
|
echo " Fish upgraded — restart your shell to use the new version."
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
else
|
else
|
||||||
set_color red; echo " $bin install failed."; set_color normal
|
set_color red; echo " $bin "(string lower $upgrade_label)" failed."; set_color normal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
set i (math $i + 1)
|
set i (math $i + 1)
|
||||||
|
|||||||
@@ -7,6 +7,17 @@ function _fish_deps_status
|
|||||||
|
|
||||||
function __fds_print_dep --argument-names bin tier
|
function __fds_print_dep --argument-names bin tier
|
||||||
if type -q $bin
|
if type -q $bin
|
||||||
|
# Special version check: fish < 4.0 is functionally incompatible
|
||||||
|
if test "$bin" = fish
|
||||||
|
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
|
||||||
|
if test -n "$_major"; and test "$_major" -lt 4
|
||||||
|
set -l _ver (fish --version 2>&1 | string replace 'fish, ' '')
|
||||||
|
set_color yellow; echo -n " ⚠ "; set_color normal
|
||||||
|
echo -n "$bin "
|
||||||
|
set_color brblack; echo "($_ver — upgrade to 4.0+ required)"; set_color normal
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
set_color green; echo -n " ✓ "; set_color normal
|
set_color green; echo -n " ✓ "; set_color normal
|
||||||
echo -n "$bin "
|
echo -n "$bin "
|
||||||
set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal
|
set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ function _fish_deps_update
|
|||||||
set -l pm_pkg $_fdc_pm[$i]
|
set -l pm_pkg $_fdc_pm[$i]
|
||||||
set -l special $_fdc_special[$i]
|
set -l special $_fdc_special[$i]
|
||||||
|
|
||||||
|
# cargo: update via rustup
|
||||||
|
if test "$special" = rustup-installer
|
||||||
|
if type -q rustup
|
||||||
|
echo "Updating $bin..."
|
||||||
|
rustup update
|
||||||
|
set updated_any 1
|
||||||
|
end
|
||||||
|
set i (math $i + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
# fzf: always use fzf-update (git-based)
|
# fzf: always use fzf-update (git-based)
|
||||||
if test "$special" = fzf-update
|
if test "$special" = fzf-update
|
||||||
echo "Updating $bin..."
|
echo "Updating $bin..."
|
||||||
@@ -37,6 +48,40 @@ function _fish_deps_update
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# lazydocker: re-run the official install/update script
|
||||||
|
if test "$special" = curl-lazydocker
|
||||||
|
echo "Updating $bin..."
|
||||||
|
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
|
||||||
|
set updated_any 1
|
||||||
|
set i (math $i + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
# wakatime: re-download the binary from github releases
|
||||||
|
if test "$special" = wakatime-binary
|
||||||
|
echo "Updating $bin..."
|
||||||
|
set -l _arch (uname -m)
|
||||||
|
switch $_arch
|
||||||
|
case x86_64; set _arch amd64
|
||||||
|
case aarch64 arm64; set _arch arm64
|
||||||
|
case armv7l; set _arch arm
|
||||||
|
case '*'; set _arch amd64
|
||||||
|
end
|
||||||
|
set -l _zip "wakatime-cli-linux-$_arch.zip"
|
||||||
|
set -l _bin_src "wakatime-cli-linux-$_arch"
|
||||||
|
set -l _wt_bin "$HOME/.config/wakatime/wakatime"
|
||||||
|
set -l _tmpdir (mktemp -d)
|
||||||
|
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
|
||||||
|
-o "$_tmpdir/$_zip"
|
||||||
|
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||||
|
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
|
||||||
|
and chmod +x "$_wt_bin"
|
||||||
|
rm -rf "$_tmpdir"
|
||||||
|
and set updated_any 1
|
||||||
|
set i (math $i + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
# pipx tools
|
# pipx tools
|
||||||
if test "$special" = pipx
|
if test "$special" = pipx
|
||||||
if type -q pipx
|
if type -q pipx
|
||||||
@@ -48,11 +93,59 @@ function _fish_deps_update
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# uv: use built-in self-updater
|
||||||
|
if test "$special" = curl-uv
|
||||||
|
echo "Updating $bin..."
|
||||||
|
uv self update
|
||||||
|
set updated_any 1
|
||||||
|
set i (math $i + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
# fish: prefer build from source via git + cargo; fall back to PM
|
||||||
|
if test "$special" = git-cargo-fish
|
||||||
|
if type -q cargo; and type -q uv
|
||||||
|
echo "Updating $bin..."
|
||||||
|
set -l _tmpdir (mktemp -d)
|
||||||
|
set -l _build_ok 0
|
||||||
|
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
|
||||||
|
and begin
|
||||||
|
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
|
||||||
|
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
|
||||||
|
true
|
||||||
|
end
|
||||||
|
and pushd "$_tmpdir"
|
||||||
|
and uv run --no-managed-python cargo install --path .
|
||||||
|
and set _build_ok 1
|
||||||
|
popd 2>/dev/null
|
||||||
|
rm -rf "$_tmpdir"
|
||||||
|
if test $_build_ok -eq 1
|
||||||
|
set updated_any 1
|
||||||
|
set_color yellow
|
||||||
|
echo " Fish updated — restart your shell to use the new version."
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
|
else if test -n "$pm_pkg"; and test -n "$pm"
|
||||||
|
echo "Updating $bin (cargo/uv unavailable, using system PM)..."
|
||||||
|
_fish_deps_pm_upgrade $pm_pkg
|
||||||
|
set updated_any 1
|
||||||
|
set_color yellow
|
||||||
|
echo " Fish updated — restart your shell to use the new version."
|
||||||
|
set_color normal
|
||||||
|
else
|
||||||
|
set_color yellow
|
||||||
|
echo " fish: cannot update — install cargo and uv to build from source"
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
|
set i (math $i + 1)
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
# curl-installer tools (starship etc.): re-run install script, which upgrades in place
|
# curl-installer tools (starship etc.): re-run install script, which upgrades in place
|
||||||
if test "$special" = curl-installer
|
if test "$special" = curl-installer
|
||||||
if test "$bin" = starship
|
if test "$bin" = starship
|
||||||
echo "Updating $bin..."
|
echo "Updating $bin..."
|
||||||
curl -sS https://starship.rs/install.sh | sh -- --yes
|
curl -sS https://starship.rs/install.sh | sh -s -- --yes
|
||||||
set updated_any 1
|
set updated_any 1
|
||||||
end
|
end
|
||||||
set i (math $i + 1)
|
set i (math $i + 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user