Fix install scripts

This commit is contained in:
Sander Declerck 2025-12-03 12:02:19 +01:00
parent ac6567ba59
commit 019d70cc52
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -33,8 +33,6 @@ function Write-Error-Custom {
# Fetch latest release version tag from GitHub # Fetch latest release version tag from GitHub
function Get-LatestVersion { function Get-LatestVersion {
Write-Info "Fetching latest release version..."
try { try {
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/AikidoSec/safe-chain/releases/latest" -UseBasicParsing $response = Invoke-RestMethod -Uri "https://api.github.com/repos/AikidoSec/safe-chain/releases/latest" -UseBasicParsing
$latestVersion = $response.tag_name $latestVersion = $response.tag_name
@ -113,6 +111,7 @@ function Remove-VoltaInstallation {
function Install-SafeChain { function Install-SafeChain {
# Fetch latest version if VERSION is not set # Fetch latest version if VERSION is not set
if ([string]::IsNullOrWhiteSpace($script:Version)) { if ([string]::IsNullOrWhiteSpace($script:Version)) {
Write-Info "Fetching latest release version..."
$script:Version = Get-LatestVersion $script:Version = Get-LatestVersion
} }

View file

@ -56,8 +56,6 @@ command_exists() {
# Fetch latest release version tag from GitHub # Fetch latest release version tag from GitHub
fetch_latest_version() { fetch_latest_version() {
info "Fetching latest release version..."
# Try using GitHub API to get the latest release tag # Try using GitHub API to get the latest release tag
if command_exists curl; then if command_exists curl; then
latest_version=$(curl -fsSL "https://api.github.com/repos/AikidoSec/safe-chain/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/') latest_version=$(curl -fsSL "https://api.github.com/repos/AikidoSec/safe-chain/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
@ -157,6 +155,7 @@ main() {
# Fetch latest version if VERSION is not set # Fetch latest version if VERSION is not set
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
info "Fetching latest release version..."
VERSION=$(fetch_latest_version) VERSION=$(fetch_latest_version)
fi fi