1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00
bitwarden-browser/scripts/snap-update.ps1

29 lines
846 B
PowerShell
Raw Normal View History

2018-08-09 16:21:36 +02:00
param (
[Parameter(Mandatory=$true)]
[string] $version
)
# Dependencies:
2018-07-27 04:05:09 +02:00
# 1. Install powershell, ex `sudo apt-get install -y powershell`
#
# To run:
2018-08-09 16:21:36 +02:00
# pwsh ./snap-update.ps1 -version 1.5.0
2018-06-04 21:24:37 +02:00
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "/..";
$distDir = $rootDir + "/dist";
2018-08-09 16:21:36 +02:00
$distSnapDir = $distDir + "/snap";
if(Test-Path -Path $distSnapDir) {
Remove-Item -Recurse -Force $distSnapDir
}
New-Item -ItemType directory -Path $distSnapDir | Out-Null
$snap = "bitwarden_" + $version + "_amd64.snap";
$distSnap = $distSnapDir + "/" + $snap;
$uri = "https://github.com/bitwarden/desktop/releases/download/v" + $version + "/" + $snap;
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $uri -OutFile $distSnap
2018-06-04 21:24:37 +02:00
2020-11-15 05:06:05 +01:00
snapcraft upload $distSnap --release stable