feat(deps): add fish-deps unified dependency management command #17
@@ -257,7 +257,7 @@ rm -f file.txt # Falls through to standard rm -f
|
||||
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/)**. If either is missing, `fish-deps install`/`update` will fall back to the system package manager instead.
|
||||
> 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
|
||||
|
||||
@@ -496,6 +496,8 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
|
||||
|
||||
| Tool | Version | Purpose |
|
||||
|---|---|---|
|
||||
| [uv](https://docs.astral.sh/uv/) | any | Python runner (needed to build Fish from source) |
|
||||
| [Rust / cargo](https://www.rust-lang.org/tools/install) | any | Installs Rust-based tools; required to build Fish |
|
||||
| [Fish](https://fishshell.com/) | **≥ 4.0** | Shell |
|
||||
| [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager |
|
||||
| [Starship](https://starship.rs/) | any | Prompt |
|
||||
@@ -505,7 +507,7 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
|
||||
|
||||
> [!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.
|
||||
> If you are on an older Fish, run `fish-deps install` or `fish-deps update` — it will build and install the latest Fish from source using git + cargo (requires cargo and uv).
|
||||
> 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
|
||||
|
||||
|
||||
@@ -11,32 +11,32 @@
|
||||
# _fdc_pm — system PM package name, or "" if not in repos
|
||||
# _fdc_special — special install key: rustup-installer | fisher-bootstrap |
|
||||
# fzf-update | paru-build | pipx | curl-installer |
|
||||
# git-cargo-fish | "" (none)
|
||||
# git-cargo-fish | curl-uv | "" (none)
|
||||
#
|
||||
# cargo is listed second so it is installed before Rust tools that depend on it.
|
||||
# uv and cargo are listed first so both are available before fish and other Rust tools.
|
||||
function _fish_deps_catalog
|
||||
set -g _fdc_bins \
|
||||
fish cargo fisher starship fzf zoxide direnv paru \
|
||||
uv cargo fish fisher starship fzf zoxide direnv paru \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
||||
|
||||
set -g _fdc_tiers \
|
||||
req req req req req req req rec \
|
||||
req req req req req req req req rec \
|
||||
int int \
|
||||
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
||||
|
||||
set -g _fdc_cargo \
|
||||
"" "" "" starship "" zoxide "" "" \
|
||||
"" "" "" "" starship "" zoxide "" "" \
|
||||
"" "" \
|
||||
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" ""
|
||||
|
||||
set -g _fdc_pm \
|
||||
fish cargo "" starship fzf zoxide direnv "" \
|
||||
uv cargo fish "" starship fzf zoxide direnv "" \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
||||
|
||||
set -g _fdc_special \
|
||||
git-cargo-fish rustup-installer fisher-bootstrap curl-installer fzf-update "" "" paru-build \
|
||||
curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build \
|
||||
wakatime-binary "" \
|
||||
"" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" ""
|
||||
end
|
||||
|
||||
@@ -47,6 +47,9 @@ function _fish_deps_install
|
||||
|
||||
# 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
|
||||
@@ -206,6 +209,20 @@ function _fish_deps_install
|
||||
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
|
||||
|
||||
@@ -93,6 +93,15 @@ function _fish_deps_update
|
||||
continue
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user