Compare commits
3 Commits
e585e0b049
...
45d709f28e
| Author | SHA1 | Date | |
|---|---|---|---|
|
45d709f28e
|
|||
|
9cd074cb9b
|
|||
|
93eec45473
|
@@ -98,7 +98,7 @@ You can use the following command to run a bash script that downloads and instal
|
|||||||
OS (Linux/MacOS) and architecture (x86_64/arm64):
|
OS (Linux/MacOS) and architecture (x86_64/arm64):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -fsSL https://raw.githubusercontent.com/Dark-Alex-17/coyote/main/install_coyote.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/Dark-Alex-17/coyote/refs/heads/main/scripts/install_coyote.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Windows/Linux/MacOS (`PowerShell`)
|
#### Windows/Linux/MacOS (`PowerShell`)
|
||||||
@@ -106,7 +106,7 @@ You can use the following command to run a PowerShell script that downloads and
|
|||||||
for your OS (Windows/Linux/MacOS) and architecture (x86_64/arm64):
|
for your OS (Windows/Linux/MacOS) and architecture (x86_64/arm64):
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/Dark-Alex-17/coyote/main/scripts/install_coyote.ps1 | iex"
|
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/Dark-Alex-17/coyote/refs/heads/main/scripts/install_coyote.ps1 | iex"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual
|
### Manual
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ switch ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) {
|
|||||||
|
|
||||||
if (-not $BinDir) {
|
if (-not $BinDir) {
|
||||||
if ($isWin) { $BinDir = Join-Path $env:LOCALAPPDATA 'coyote\bin' }
|
if ($isWin) { $BinDir = Join-Path $env:LOCALAPPDATA 'coyote\bin' }
|
||||||
else { $home = $env:HOME; if (-not $home) { $home = (Get-Item -Path ~).FullName }; $BinDir = Join-Path $home '.local/bin' }
|
else { $userHome = $env:HOME; if (-not $userHome) { $userHome = (Get-Item -Path ~).FullName }; $BinDir = Join-Path $userHome '.local/bin' }
|
||||||
}
|
}
|
||||||
New-Item -ItemType Directory -Force -Path $BinDir | Out-Null
|
New-Item -ItemType Directory -Force -Path $BinDir | Out-Null
|
||||||
|
|
||||||
@@ -95,13 +95,13 @@ if ($asset.name -match '\.zip$') {
|
|||||||
[System.IO.Compression.ZipFile]::ExtractToDirectory($archive, $extractDir)
|
[System.IO.Compression.ZipFile]::ExtractToDirectory($archive, $extractDir)
|
||||||
} elseif ($asset.name -match '\.tar\.gz$' -or $asset.name -match '\.tgz$') {
|
} elseif ($asset.name -match '\.tar\.gz$' -or $asset.name -match '\.tgz$') {
|
||||||
$tar = Get-Command tar -ErrorAction SilentlyContinue
|
$tar = Get-Command tar -ErrorAction SilentlyContinue
|
||||||
if ($tar) { & $tar.FullName -xzf $archive -C $extractDir }
|
if ($tar) { & $tar.Source -xzf $archive -C $extractDir }
|
||||||
else { Fail "Asset is tar archive but 'tar' is not available." }
|
else { Fail "Asset is tar archive but 'tar' is not available." }
|
||||||
} else {
|
} else {
|
||||||
try { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($archive, $extractDir) }
|
try { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($archive, $extractDir) }
|
||||||
catch {
|
catch {
|
||||||
$tar = Get-Command tar -ErrorAction SilentlyContinue
|
$tar = Get-Command tar -ErrorAction SilentlyContinue
|
||||||
if ($tar) { & $tar.FullName -xf $archive -C $extractDir } else { Fail "Unknown archive format; neither zip nor tar workable." }
|
if ($tar) { & $tar.Source -xf $archive -C $extractDir } else { Fail "Unknown archive format; neither zip nor tar workable." }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
+13
-22
@@ -133,30 +133,21 @@ else
|
|||||||
echo "Error: unsupported OS for this installer: $OS" >&2; exit 1
|
echo "Error: unsupported OS for this installer: $OS" >&2; exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DL_URLS=$(grep -oE '"browser_download_url":[[:space:]]*"[^"]+"' "$JSON" \
|
||||||
|
| sed -E 's/.*"browser_download_url":[[:space:]]*"//; s/"$//' \
|
||||||
|
|| true)
|
||||||
|
|
||||||
ASSET_NAME=""; ASSET_URL=""
|
ASSET_NAME=""; ASSET_URL=""
|
||||||
for candidate in "${ASSET_CANDIDATES[@]}"; do
|
for candidate in "${ASSET_CANDIDATES[@]}"; do
|
||||||
NAME=$(grep -oE '"name":\s*"[^"]+"' "$JSON" | sed 's/"name":\s*"//; s/"$//' | grep -Fx "$candidate" || true)
|
while IFS= read -r url; do
|
||||||
if [[ -n "$NAME" ]]; then
|
[[ -z "$url" ]] && continue
|
||||||
ASSET_NAME="$NAME"
|
if [[ "$url" == */"$candidate" ]]; then
|
||||||
ASSET_URL=$(awk -v pat="$NAME" '
|
ASSET_NAME="$candidate"
|
||||||
BEGIN{ FS=":"; want=0 }
|
ASSET_URL="$url"
|
||||||
/"name"/ {
|
break
|
||||||
line=$0;
|
fi
|
||||||
gsub(/^\s+|\s+$/,"",line);
|
done <<< "$DL_URLS"
|
||||||
gsub(/"name"\s*:\s*"|"/ ,"", line);
|
[[ -n "$ASSET_URL" ]] && break
|
||||||
want = (line==pat) ? 1 : 0;
|
|
||||||
next
|
|
||||||
}
|
|
||||||
want==1 && /"browser_download_url"/ {
|
|
||||||
u=$0;
|
|
||||||
gsub(/^\s+|\s+$/,"",u);
|
|
||||||
gsub(/.*"browser_download_url"\s*:\s*"|".*/ ,"", u);
|
|
||||||
print u;
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
' "$JSON")
|
|
||||||
if [[ -n "$ASSET_URL" ]]; then break; fi
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -z "$ASSET_URL" ]]; then
|
if [[ -z "$ASSET_URL" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user