-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/compute-dependency-hashes
- Loading branch information
Showing
7 changed files
with
841 additions
and
451 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
#Requires -Version 5 | ||
|
||
<# | ||
.SYNOPSIS | ||
Executes the latest available FOSSA release from GitHub. | ||
.PARAMETER ApiKey | ||
The FOSSA API key to be used for the current Powershell Session. | ||
.PARAMETER TempDir | ||
The directory used for FOSSA download and extraction. | ||
#> | ||
|
||
[CmdletBinding()] | ||
Param( | ||
$TempDir = $env:TEMP, | ||
[Parameter(Mandatory=$true)] | ||
$ApiKey | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
$github = "https://github.com" | ||
$latestUri = "$github/fossas/fossa-cli/releases/latest" | ||
$extractDir = "$env:ALLUSERSPROFILE\fossa-cli" | ||
|
||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 | ||
|
||
$releasePage = Invoke-RestMethod $latestUri | ||
|
||
if ($releasePage -inotmatch 'href=\"(.*?releases\/download\/.*?windows.*?)\"') | ||
{ | ||
throw "Did not find latest Windows release at $latestUri" | ||
} | ||
|
||
$downloadUri = "$github/$($Matches[1])" | ||
Write-Verbose "Download from: $downloadUri" | ||
|
||
$zipFile = "$TempDir\fossa-cli.zip" | ||
|
||
(New-Object System.Net.WebClient).DownloadFile($downloadUri, $zipFile) | ||
|
||
Expand-Archive -Path $zipFile -DestinationPath $extractDir -Force | ||
|
||
$ErrorActionPreference = "Continue" | ||
|
||
$env:FOSSA_API_KEY = $ApiKey | ||
|
||
& "$TempDir\fossa-cli\fossa.exe" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
vendor | ||
vendor/* | ||
!vendor/vendor.json |
Oops, something went wrong.