dot: 重构 bashrc.d 目录结构,调整版本(包)管理器脚本加载顺序
- 将 mise、rust 等管理器脚本移入 manager/ 子目录,与工具脚本区分 - mise/volta 的补全改到各自 activate 函数内延迟生成,避免未激活时执行 - 新增 uv/uvx 的 bash 补全 - .bashrc 拆分为先加载 manager/ 再加载顶层脚本的两段流程 - .xprofile 改用 bash 解释并复用相同的脚本加载流程
This commit is contained in:
17
dot/.bashrc.d/manager/rust.bash
Normal file
17
dot/.bashrc.d/manager/rust.bash
Normal file
@@ -0,0 +1,17 @@
|
||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||
source "${basedir}/../function.bash"
|
||||
|
||||
unset basedir
|
||||
|
||||
if [[ -d "${HOME}/.cargo/bin" ]]; then
|
||||
add-to-path "${HOME}/.cargo/bin"
|
||||
fi
|
||||
|
||||
if [[ -e "${HOME}/.cargo/env" ]]; then
|
||||
. "${HOME}/.cargo/env"
|
||||
fi
|
||||
|
||||
if [[ -x "$(type -p rustup)" ]]; then
|
||||
generate-bash-completion rustup "rustup completions bash cargo"
|
||||
generate-bash-completion cargo "rustup completions bash cargo"
|
||||
fi
|
||||
Reference in New Issue
Block a user