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