mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 04:22:06 +08:00
fix: update release file names and install scripts
This commit is contained in:
parent
62129aa239
commit
1f1f4144bb
@ -30,14 +30,14 @@ archives:
|
||||
- id: binary
|
||||
format: binary
|
||||
name_template: >-
|
||||
{{ .Binary }}_
|
||||
{{ .Binary }}
|
||||
{{- if eq .Os "windows" }}.exe{{ else }}_
|
||||
{{- .Os }}_
|
||||
{{- if eq .Arch "amd64" }}x64{{ end }}
|
||||
{{- if eq .Arch "386" }}x86{{ end }}
|
||||
{{- if eq .Arch "arm64" }}arm64{{ end }}
|
||||
{{- if and (eq .Os "darwin") (eq .Arch "amd64") }}_intel{{ end }}
|
||||
{{- if and (eq .Os "darwin") (eq .Arch "arm64") }}_apple_silicon{{ end }}
|
||||
{{- if eq .Os "windows" }}.exe{{ end }}
|
||||
{{- if and (eq .Os "darwin") (eq .Arch "arm64") }}_apple_silicon{{ end }}{{ end }}
|
||||
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
|
@ -37,9 +37,9 @@ trap {
|
||||
# Detect system architecture
|
||||
function Get-SystemArch {
|
||||
if ([Environment]::Is64BitOperatingSystem) {
|
||||
return "amd64"
|
||||
return "x64"
|
||||
} else {
|
||||
return "386"
|
||||
return "x86"
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,11 +79,12 @@ function Install-CursorModifier {
|
||||
|
||||
# Get latest release
|
||||
try {
|
||||
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/dacrab/cursor-id-modifier/releases/latest"
|
||||
$downloadUrl = $latestRelease.assets | Where-Object { $_.name -match "windows_$arch" } | Select-Object -ExpandProperty browser_download_url
|
||||
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/dacrab/go-cursor-help/releases/latest"
|
||||
$binaryName = "cursor-id-modifier.exe"
|
||||
$downloadUrl = $latestRelease.assets | Where-Object { $_.name -eq $binaryName } | Select-Object -ExpandProperty browser_download_url
|
||||
|
||||
if (!$downloadUrl) {
|
||||
throw "Could not find download URL for windows_$arch"
|
||||
throw "Could not find download URL for $binaryName"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
|
@ -15,7 +15,7 @@ trap 'rm -rf "$TMP_DIR"' EXIT
|
||||
|
||||
# Detect system information
|
||||
detect_system() {
|
||||
local os arch
|
||||
local os arch suffix
|
||||
|
||||
case "$(uname -s)" in
|
||||
Linux*) os="linux";;
|
||||
@ -24,13 +24,18 @@ detect_system() {
|
||||
esac
|
||||
|
||||
case "$(uname -m)" in
|
||||
x86_64) arch="amd64";;
|
||||
aarch64) arch="arm64";;
|
||||
arm64) arch="arm64";;
|
||||
x86_64)
|
||||
arch="x64"
|
||||
[ "$os" = "darwin" ] && suffix="_intel"
|
||||
;;
|
||||
aarch64|arm64)
|
||||
arch="arm64"
|
||||
[ "$os" = "darwin" ] && suffix="_apple_silicon"
|
||||
;;
|
||||
*) echo "Unsupported architecture"; exit 1;;
|
||||
esac
|
||||
|
||||
echo "$os $arch"
|
||||
echo "$os $arch $suffix"
|
||||
}
|
||||
|
||||
# Download with progress using curl or wget
|
||||
@ -65,7 +70,7 @@ main() {
|
||||
echo -e "${BLUE}Starting installation...${NC}"
|
||||
|
||||
# Detect system
|
||||
read -r OS ARCH <<< "$(detect_system)"
|
||||
read -r OS ARCH SUFFIX <<< "$(detect_system)"
|
||||
echo -e "${GREEN}Detected: $OS $ARCH${NC}"
|
||||
|
||||
# Set installation directory
|
||||
@ -76,8 +81,9 @@ main() {
|
||||
setup_install_dir "$INSTALL_DIR"
|
||||
|
||||
# Download latest release
|
||||
LATEST_URL="https://api.github.com/repos/dacrab/cursor-id-modifier/releases/latest"
|
||||
DOWNLOAD_URL=$(curl -s "$LATEST_URL" | grep "browser_download_url.*${OS}_${ARCH}" | cut -d '"' -f 4)
|
||||
LATEST_URL="https://api.github.com/repos/dacrab/go-cursor-help/releases/latest"
|
||||
BINARY_NAME="cursor-id-modifier_${OS}_${ARCH}${SUFFIX}"
|
||||
DOWNLOAD_URL=$(curl -s "$LATEST_URL" | grep "browser_download_url.*${BINARY_NAME}" | cut -d '"' -f 4)
|
||||
|
||||
if [ -z "$DOWNLOAD_URL" ]; then
|
||||
echo -e "${RED}Error: Could not find download URL for $OS $ARCH${NC}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user