@@ -21,13 +21,14 @@ function gittagpush() {
alias gittags='git --no-pager tag -l -n'
function reloadrc() {
- if [[ "$0" =~ "zsh" ]]
- then
- echo "正在使用zsh"
- source ~/.zshrc
+ if [ -n "$ZSH_VERSION" ]; then
+ echo "正在使用zsh"
+ source ~/.zshrc
+ elif [ -n "$BASH_VERSION" ]; then
+ echo "正在使用bash"
+ source ~/.bashrc
else
- echo "正在使用bash"
- source ~/.bashrc
+ echo "无法确定当前 Shell 类型"
fi
}