修改zsh判断方式

This commit is contained in:
Max Zhao
2024-01-25 02:13:04 +08:00
committed by GitHub
parent 8975e0bee5
commit d985a821b9

View File

@@ -215,7 +215,7 @@ if [ -n "$profile" ];then
echo "export CRASHDIR=\"$CRASHDIR\"" >> $profile #设置路径环境变量
source $profile &>/dev/null || echo 运行错误请使用bash而不是dash运行安装命令
#适配zsh环境变量
[ -n "$(ls -l /bin/sh|grep -oE 'zsh')" ] && [ -z "$(cat ~/.zshrc 2>/dev/null|grep CRASHDIR)" ] && {
[ -n "$(cat /etc/shells|grep -oE 'zsh')" ] && [ -z "$(cat ~/.zshrc 2>/dev/null|grep CRASHDIR)" ] && {
echo "alias crash=\"$shtype $CRASHDIR/menu.sh\"" >> ~/.zshrc
echo "export CRASHDIR=\"$CRASHDIR\"" >> ~/.zshrc
source ~/.zshrc &>/dev/null