mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-12-25 11:54:25 +08:00
26 lines
620 B
Bash
26 lines
620 B
Bash
#!/bin/bash
|
|
|
|
FILENAMES=$(ls)
|
|
for FILENAME in $FILENAMES
|
|
do
|
|
if [[ ! ($FILENAME =~ ".exe" || $FILENAME =~ ".sh")]];then
|
|
gzip -S ".gz" $FILENAME
|
|
elif [[ $FILENAME =~ ".exe" ]];then
|
|
zip -m ${FILENAME%.*}.zip $FILENAME
|
|
else echo "skip $FILENAME"
|
|
fi
|
|
done
|
|
|
|
FILENAMES=$(ls)
|
|
for FILENAME in $FILENAMES
|
|
do
|
|
if [[ $FILENAME =~ ".zip" ]];then
|
|
echo "rename $FILENAME"
|
|
mv $FILENAME ${FILENAME%.*}-${VERSION}.zip
|
|
elif [[ $FILENAME =~ ".gz" ]];then
|
|
echo "rename $FILENAME"
|
|
mv $FILENAME ${FILENAME%.*}-${VERSION}.gz
|
|
else
|
|
echo "skip $FILENAME"
|
|
fi
|
|
done |