Last active
January 4, 2024 17:11
-
-
Save fanlushuai/c0f6cc8e99c8c0b16be83db70a34548f to your computer and use it in GitHub Desktop.
自动压缩,发布到网盘 gofile,并生成发布记录
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# apt-get install zip unzip | |
# apt-get install jq | |
set -e | |
name=my-ahks | |
version=v1.0 | |
currentTime=$(date +"%m-%d_%H_%M") | |
zipName=$name-$version-${currentTime}.zip | |
zip -r ${zipName} **/*.png **/*.py **/*.ahk | |
publicLogFile=publish-log.md | |
# store可以 1-9.如果发现不可用自行切换。偶尔不行吧。 | |
curl -F file=@${zipName} https://store9.gofile.io/uploadFile > rsp${currentTime} | |
log="[$(cat rsp${currentTime} | jq -r '.data.fileName')]($(cat rsp${currentTime} | jq -r '.data.downloadPage'))" | |
echo ${log} | |
if [ ! -f $publicLogFile ];then | |
touch $publicLogFile | |
echo "## 发布记录" >> $publicLogFile | |
echo "" >> $publicLogFile | |
fi | |
sed -i "2a${log}" ${publicLogFile} | |
rm -rf ${zipName} rsp${currentTime} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment