1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-27 12:26:38 +01:00

choco pack script with chocolateyinstall updates

This commit is contained in:
Kyle Spearrin 2018-02-19 22:27:43 -05:00
parent b0f6105ae6
commit ed9e49ab70
2 changed files with 18 additions and 4 deletions

View File

@ -1,8 +1,22 @@
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\..";
$distDir = $rootDir + "\dist";
$nuspec = $rootDir + "\stores\chocolatey\bitwarden.nuspec";
$chocoDir = $rootDir + "\stores\chocolatey";
$distChocoDir = $distDir + "\chocolatey";
if(Test-Path -Path $distChocoDir) {
Remove-Item -Recurse -Force $distChocoDir
}
Copy-Item -Path $chocoDir -Destination $distChocoDir Recurse
$srcPackage = $rootDir + "\src\package.json";
$srcPackageVersion = (Get-Content -Raw -Path $srcPackage | ConvertFrom-Json).version;
choco pack $nuspec --version $srcPackageVersion --out $distDir
$exe = $distDir + "\nsis-web\Bitwarden Installer " + $srcPackageVersion + ".exe";
$checksum = checksum -t sha256 $exe
$nuspec = $distChocoDir + "\bitwarden.nuspec";
$chocoInstall = $distChocoDir + "\tools\chocolateyinstall.ps1";
(Get-Content $chocoInstall).replace('__version__', $srcPackageVersion).replace('__checksum__', $checksum) | Set-Content $chocoInstall
choco pack $nuspec --version $srcPackageVersion --out $distChocoDir

View File

@ -1,7 +1,7 @@
$ErrorActionPreference = 'Stop';
$url = 'https://github.com/bitwarden/desktop/releases/download/v0.0.5/bitwarden-web-setup-0.0.5.exe'
$checksum = '017E5B289EB583E93DB7F108FB5CB0AD28AB44EEE045A8A096B442CAF822567F'
$url = 'https://github.com/bitwarden/desktop/releases/download/v__version__/bitwarden-web-setup-__version__.exe'
$checksum = '__checksum__'
$packageArgs = @{
packageName = 'bitwarden'