Skip to content

shell脚本中自动获取 GitHub 最新版本号

参考 https://sobaigu.com/shell-get-lastest-version-from-github.html

# 定义版本变量
tag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/lhc70000/iina/releases/latest" | jq -r '.tag_name')
# 下载链接替换为变量
wget https://github.com/iina/iina/releases/download/${tag}/IINA.${tag}.dmg

Leave a Reply

Your email address will not be published.