-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script for downloading jfrog-cli
- Loading branch information
1 parent
7cf98ed
commit b88724e
Showing
2 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Check if the JFROG_CLI_VERSION environment variable is set, if not using latest version | ||
if (-not $env:JFROG_CLI_VERSION) { | ||
Write-Output "Environment variable 'JFROG_CLI_VERSION' is not set. Using latest version as default." | ||
$env:JFROG_CLI_VERSION = "[RELEASE]" | ||
} | ||
|
||
# Define the URL for the JFrog CLI executable | ||
$jfrogCliUrl = "https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/$($env:JFROG_CLI_VERSION)/jfrog-cli-windows-amd64/jf.exe" | ||
|
||
# Define the destination path for the downloaded file | ||
$destinationPath = Join-Path (Get-Location).Path "JFrogVSExtension/Resources/jfrog.exe" | ||
|
||
# Download the JFrog CLI executable | ||
Invoke-WebRequest -Uri $jfrogCliUrl -OutFile $destinationPath -Verbose | ||
|
||
|
||
# Verify the file was downloaded successfully | ||
if (Test-Path -Path $destinationPath) { | ||
Write-Output "JFrog CLI v$env:JFROG_CLI_VERSION successfully downloaded to: $destinationPath" | ||
} else { | ||
Write-Output "Failed to download JFrog CLI to: $destinationPath" | ||
} |