Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 兼容 #80

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function pull_liteloader() {
echo "通过GitHub获取最新Release版本"
LATEST_RELEASE_URL="https://api.github.com/repos/LiteLoaderQQNT/LiteLoaderQQNT/releases/latest"
LATEST_RELEASE_INFO=$(curl -s $LATEST_RELEASE_URL)
LATEST_TAG=$(echo "$LATEST_RELEASE_INFO" | grep -oP '"tag_name": "\K(.*?)(?=")')
# LATEST_TAG=$(echo "$LATEST_RELEASE_INFO" | grep -oP '"tag_name": "\K(.*?)(?=")') # macOS 不支持 grep -P
LATEST_TAG=$(echo "$LATEST_RELEASE_INFO" | sed -n 's/.*"tag_name": "\(.*\)".*/\1/p')
repo_url="https://github.com/LiteLoaderQQNT/LiteLoaderQQNT.git"
archive_url="https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/archive/refs/tags/$LATEST_TAG.tar.gz"
;;
Expand All @@ -89,7 +90,8 @@ function pull_liteloader() {
2)
echo "通过GitLink获取最新Release版本"
TAG_URL="https://gitlink.org.cn/api/shenmo7192/LiteLoaderQQNT/tags.json"
LATEST_TAG=$(echo $(curl -s $TAG_URL) | grep -oP '"name"\s*:\s*"\K[^"]+' | head -n 1)
# LATEST_TAG=$(echo $(curl -s $TAG_URL) | grep -oP '"name"\s*:\s*"\K[^"]+' | head -n 1)
LATEST_TAG=$(echo $(curl -s $TAG_URL) | sed -n 's/.*"name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1)
repo_url="https://gitlink.org.cn/shenmo7192/LiteLoaderQQNT.git"
archive_url="https://www.gitlink.org.cn/api/shenmo7192/liteloaderqqnt/archive/$LATEST_TAG.tar.gz"
;;
Expand Down Expand Up @@ -119,7 +121,7 @@ function install_liteloader() {
ll_path="/opt"
sudo_cmd="sudo"
elif [ "$platform" == "macos" ]; then
qq_path="Applications/QQ.app/Contents/Resources/"
qq_path="/Applications/QQ.app/Contents/Resources"
ll_path="$HOME/Library/Containers/com.tencent.qq/Data/Documents"
sudo_cmd=""
fi
Expand Down Expand Up @@ -341,4 +343,4 @@ echo "插件错误会导致 LiteLoaderQQNT 无法正常启动"
echo "脚本将在 3 秒后退出..."
sleep 3
exit 0


Loading