mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add --include-python and --ci args
This commit is contained in:
parent
eddb4f3f75
commit
b60cb63fdb
2 changed files with 92 additions and 9 deletions
|
|
@ -1,6 +1,23 @@
|
|||
# Downloads and installs safe-chain for Windows
|
||||
# Usage: iex (iwr "https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1" -UseBasicParsing)
|
||||
#
|
||||
# Usage examples:
|
||||
#
|
||||
# Default (JavaScript packages only):
|
||||
# iex (iwr "https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1" -UseBasicParsing)
|
||||
#
|
||||
# CI setup (JavaScript packages only):
|
||||
# iex "& { $(iwr 'https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1' -UseBasicParsing) } -ci"
|
||||
#
|
||||
# Include Python packages:
|
||||
# iex "& { $(iwr 'https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1' -UseBasicParsing) } -includepython"
|
||||
#
|
||||
# CI setup with Python packages:
|
||||
# iex "& { $(iwr 'https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1' -UseBasicParsing) } -ci -includepython"
|
||||
|
||||
param(
|
||||
[switch]$ci,
|
||||
[switch]$includepython
|
||||
)
|
||||
|
||||
$Version = "v0.0.4-binaries-beta"
|
||||
$InstallDir = Join-Path $env:USERPROFILE ".safe-chain\bin"
|
||||
|
|
@ -139,19 +156,32 @@ function Install-SafeChain {
|
|||
|
||||
Write-Info "Binary installed to: $finalFile"
|
||||
|
||||
# Build setup command based on parameters
|
||||
$setupCmd = if ($ci) { "setup-ci" } else { "setup" }
|
||||
$setupArgs = @()
|
||||
if ($includepython) {
|
||||
$setupArgs += "--include-python"
|
||||
}
|
||||
|
||||
# Execute safe-chain setup
|
||||
Write-Info "Running safe-chain $setupCmd $(if ($setupArgs) { $setupArgs -join ' ' })..."
|
||||
try {
|
||||
$env:Path = "$env:Path;$InstallDir"
|
||||
& $finalFile setup
|
||||
|
||||
if ($setupArgs) {
|
||||
& $finalFile $setupCmd $setupArgs
|
||||
} else {
|
||||
& $finalFile $setupCmd
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Warn "safe-chain was installed but setup encountered issues."
|
||||
Write-Warn "You can run 'safe-chain setup' manually later."
|
||||
Write-Warn "You can run 'safe-chain $setupCmd $(if ($setupArgs) { $setupArgs -join ' ' })' manually later."
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Warn "safe-chain was installed but setup encountered issues: $_"
|
||||
Write-Warn "You can run 'safe-chain setup' manually later."
|
||||
Write-Warn "You can run 'safe-chain $setupCmd $(if ($setupArgs) { $setupArgs -join ' ' })' manually later."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue