-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.ps1
More file actions
20 lines (17 loc) · 770 Bytes
/
install.ps1
File metadata and controls
20 lines (17 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$InstallerArgs
)
$repo = if ($env:BYBIT_CLI_REPO) { $env:BYBIT_CLI_REPO } else { "kdkiss/bybit-cli" }
$url = "https://github.com/$repo/releases/latest/download/bybit-cli-installer.ps1"
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ("bybit-cli-" + [System.Guid]::NewGuid().ToString("N"))
$installerPath = Join-Path $tempDir "bybit-cli-installer.ps1"
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
try {
Write-Host "Downloading generated installer from $url to $installerPath"
Invoke-WebRequest -Uri $url -OutFile $installerPath
& $installerPath @InstallerArgs
}
finally {
Remove-Item -LiteralPath $tempDir -Recurse -Force -ErrorAction SilentlyContinue
}