1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00
bitwarden-browser/scripts/choco-pack.ps1
2018-02-28 09:18:35 -05:00

23 lines
916 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\..";
$distDir = $rootDir + "\dist";
$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;
$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