From c29cab7caffc55776e9060242532757860bd8186 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 24 Jul 2024 14:23:50 +0800 Subject: [PATCH] Update install.sh --- install.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f6b62a7..4aef777 100755 --- a/install.sh +++ b/install.sh @@ -39,10 +39,19 @@ curl -O -L "${isChinaProxy}https://github.com/sohaha/zzz/releases/download/v${LA if [ $? -eq 0 ];then echo "Untar..." tar zxf "$F" - sudo cp -f zzz /usr/local/bin - chmod +x /usr/local/bin/zzz - echo "Install done" - /usr/local/bin/zzz --help + + P="/usr/local/bin" + + sudo cp -f zzz $P + if [ $? -eq 0 ];then + echo "Install done" + else + P=$(echo $PATH | cut -d ':' -f 1) + sudo cp -f zzz $P + fi + + chmod +x "${P}/zzz" + "${P}/zzz" --help rm -rf /tmp/zzz else echo "Install fail..."