choco push script

This commit is contained in:
Kyle Spearrin 2018-08-08 21:58:24 -04:00
parent bf6914755b
commit 6266e68c14
1 changed files with 26 additions and 0 deletions

26
scripts/choco-push.ps1 Normal file
View File

@ -0,0 +1,26 @@
param (
[Parameter(Mandatory=$true)]
[string] $version
)
# To run:
# .\choco-push.ps1 -version 1.3.0
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\..";
$distDir = $rootDir + "\dist";
$distChocoDir = $distDir + "\chocolatey";
if(Test-Path -Path $distChocoDir) {
Remove-Item -Recurse -Force $distChocoDir
}
New-Item -ItemType directory -Path $distChocoDir | Out-Null
$nupkg = "bitwarden-cli." + $version + ".nupkg"
$uri = "https://github.com/bitwarden/cli/releases/download/v" + $version + "/" + $nupkg;
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $uri -OutFile $($distChocoDir + "\" + $nupkg)
cd $distChocoDir
choco push
cd $rootDir