23 lines
517 B
Bash
23 lines
517 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
ZOLA_VERSION="0.19.2"
|
|
|
|
BASE_URL="https://git.mamahaha.work/api/packages/actions/generic/zola"
|
|
echo "Checking Zola version $ZOLA_VERSION..."
|
|
|
|
# 使用 -I 只获取头信息,-s 静默模式
|
|
if ! curl -Is "${BASE_URL}/${ZOLA_VERSION}/zola" | grep -q "200 OK"; then
|
|
echo "Error: Version $ZOLA_VERSION not found"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Downloading Zola version $ZOLA_VERSION..."
|
|
curl -OJ "${BASE_URL}/${ZOLA_VERSION}/zola"
|
|
|
|
chmod +x zola
|
|
sudo mv zola /usr/local/bin
|
|
|
|
echo "Zola installed successfully."
|