2023-10-08 22:26:07 -05:00
|
|
|
function _tide_remove_unusable_items
|
|
|
|
# Remove tool-specific items for tools the machine doesn't have installed
|
|
|
|
set -l removed_items
|
2023-11-19 14:34:47 -06:00
|
|
|
for item in aws crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox
|
2023-10-08 22:26:07 -05:00
|
|
|
contains $item $tide_left_prompt_items $tide_right_prompt_items || continue
|
|
|
|
|
|
|
|
set -l cli_names $item
|
|
|
|
switch $item
|
|
|
|
case distrobox # there is no 'distrobox' command inside the container
|
|
|
|
set cli_names distrobox-export # 'distrobox-export' and 'distrobox-host-exec' are available
|
|
|
|
case nix_shell
|
|
|
|
set cli_names nix nix-shell
|
2023-11-19 14:34:47 -06:00
|
|
|
case python
|
|
|
|
set cli_names python python3
|
2023-10-08 22:26:07 -05:00
|
|
|
end
|
|
|
|
type --query $cli_names || set -a removed_items $item
|
|
|
|
end
|
|
|
|
|
|
|
|
set -U _tide_left_items (for item in $tide_left_prompt_items
|
|
|
|
contains $item $removed_items || echo $item
|
|
|
|
end)
|
|
|
|
set -U _tide_right_items (for item in $tide_right_prompt_items
|
|
|
|
contains $item $removed_items || echo $item
|
|
|
|
end)
|
|
|
|
end
|