Coexist with a desktop that already manages its tools (Omarchy)
On an Omarchy laptop bootstrap left two of almost everything: VS Code from both pacman and the tarball (two menu entries, one shared ~/.config/Code profile), and kubectl/helm/k9s/kubectx/yq/jq/node/ansible in ~/.local/bin behind mise and pacman copies that always won on PATH. The zsh helpers (op*, grmb, secrets.env) also never reached the bash login shell. - lib/fetch.sh: add `shadowed`, true when another copy of a tool comes earlier on PATH than ~/.local/bin. Always false where zshrc puts ~/.local/bin first, so VM installs are unchanged. - bin/, node/, ansible/: skip tools that are shadowed. - vscode/: defer to any system `code`, and remove a tarball copy this module installed earlier. - bash/: new module; bash port of the zshrc helpers, sourced from ~/.bashrc via a marked block. No-ops without ~/.bashrc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+25
-18
@@ -238,35 +238,42 @@ install_coder() {
|
||||
# The subshell re-enables `set -e` inside itself (it is disabled for a command
|
||||
# being tested by `if`), so a failed download still aborts that tool's function
|
||||
# before mark_version stamps a version that was never installed.
|
||||
#
|
||||
# try <install_fn> <binary> also skips the tool when another <binary> already
|
||||
# wins on PATH (see `shadowed` in lib/fetch.sh): a copy here would never run.
|
||||
FAILED=""
|
||||
try() {
|
||||
if _winner="$(shadowed "$2")"; then
|
||||
fsay "$2: $_winner comes first on PATH; skipping (a copy in $BIN_DIR would never run)."
|
||||
return 0
|
||||
fi
|
||||
if ( set -e; "$1" ); then return 0; fi
|
||||
FAILED="$FAILED ${1#install_}"
|
||||
fsay "WARNING: ${1#install_} failed to install; continuing."
|
||||
}
|
||||
|
||||
try install_jq
|
||||
try install_kubectl
|
||||
try install_oidc_login
|
||||
try install_helm
|
||||
try install_k9s
|
||||
try install_jq jq
|
||||
try install_kubectl kubectl
|
||||
try install_oidc_login kubectl-oidc_login
|
||||
try install_helm helm
|
||||
try install_k9s k9s
|
||||
if docker_full_available; then
|
||||
try install_kind
|
||||
try install_kind kind
|
||||
else
|
||||
fsay "Skipping kind: full (non-rootless) Docker not available."
|
||||
fi
|
||||
try install_kubectx
|
||||
try install_kubens
|
||||
try install_stern
|
||||
try install_yq
|
||||
try install_tofu
|
||||
try install_task
|
||||
try install_terragrunt
|
||||
try install_1p
|
||||
try install_opencode
|
||||
try install_zarf
|
||||
try install_packer
|
||||
try install_coder
|
||||
try install_kubectx kubectx
|
||||
try install_kubens kubens
|
||||
try install_stern stern
|
||||
try install_yq yq
|
||||
try install_tofu tofu
|
||||
try install_task task
|
||||
try install_terragrunt terragrunt
|
||||
try install_1p op
|
||||
try install_opencode opencode
|
||||
try install_zarf zarf
|
||||
try install_packer packer
|
||||
try install_coder coder
|
||||
|
||||
if [ -n "$FAILED" ]; then
|
||||
fsay ""
|
||||
|
||||
Reference in New Issue
Block a user