Skip to content

Commit

Permalink
🚀 chore: Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaha authored Aug 11, 2024
1 parent c29cab7 commit 0fa1df6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,26 @@ F="zzz_${LAST_VERSION/v/}_${os}_${arch}.tar.gz"
echo "Download tar.gz ..."
curl -O -L "${isChinaProxy}https://github.com/sohaha/zzz/releases/download/v${LAST_VERSION}/$F"

function cpzzz() {
if command -v sudo &> /dev/null; then
sudo cp -f zzz $P
else
cp -f zzz $P
fi
}

if [ $? -eq 0 ];then
echo "Untar..."
tar zxf "$F"

P="/usr/local/bin"

sudo cp -f zzz $P
cpzzz
if [ $? -eq 0 ];then
echo "Install done"
else
P=$(echo $PATH | cut -d ':' -f 1)
sudo cp -f zzz $P
cpzzz
fi

chmod +x "${P}/zzz"
Expand Down

0 comments on commit 0fa1df6

Please sign in to comment.