1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-29 17:38:04 +01:00
bitwarden-browser/apps/cli/scripts/choco-update.ps1

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
741 B
PowerShell
Raw Normal View History

2018-06-04 22:59:57 +02:00
param (
2018-08-09 16:12:35 +02:00
[Parameter(Mandatory=$true)]
[string] $version
2018-06-04 22:59:57 +02:00
)
# To run:
2018-08-09 16:12:35 +02:00
# .\choco-update.ps1 -version 1.3.0
2018-05-23 20:42:46 +02:00
$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
}
2018-08-09 16:12:35 +02:00
New-Item -ItemType directory -Path $distChocoDir | Out-Null
2018-05-23 20:42:46 +02:00
2018-08-09 16:12:35 +02:00
$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)
2018-05-23 20:42:46 +02:00
2018-08-09 16:12:35 +02:00
cd $distChocoDir
choco push
cd $rootDir