shell命令:删除当前.sh文件所在目录下的zip包,并且重新打包
1 filepath=$(cd "$(dirname "$0")"; pwd) 2 packagePath="$filepath"/package 3 zipPath="$filepath"/package.zip 4 5 if [ -d "$packagePath" ]; then 6 #删除旧zip包 7 rm -fr "$zipPath" 8 #重新打包 9 10 # zip -r "$packagePath".zip "$packagePath" 11 cd "$filepath" 12 zip -r package.zip package/* 13 14 echo "=-=-=-=-=-=-=-=-=-=-" 15 echo "打包成功" 16 else 17 echo "=-=-=-=-=-=-=-=-=-=-" 18 echo "打包失败,package目录不存在!!!" 19 fi 20 echo "=-=-=-=-=-=-=-=-=-=-"