Skip to content

Instantly share code, notes, and snippets.

@fanlushuai
Last active January 4, 2024 17:11
Show Gist options
  • Save fanlushuai/c0f6cc8e99c8c0b16be83db70a34548f to your computer and use it in GitHub Desktop.
Save fanlushuai/c0f6cc8e99c8c0b16be83db70a34548f to your computer and use it in GitHub Desktop.
自动压缩,发布到网盘 gofile,并生成发布记录
#!/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