1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-08-27 23:31:41 +02:00
bitwarden-browser/scripts/choco-pack.ps1

29 lines
926 B
PowerShell
Raw Normal View History

2018-05-23 20:42:46 +02:00
# To run:
# .\choco-pack.ps1
#
# and then push to choco with:
# cd ..\dist\chocolatey
# choco push
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\..";
$distDir = $rootDir + "\dist";
$chocoDir = $rootDir + "\stores\chocolatey";
$distChocoDir = $distDir + "\chocolatey";
$distChocoToolsDir = $distDir + "\chocolatey\tools";
if(Test-Path -Path $distChocoDir) {
Remove-Item -Recurse -Force $distChocoDir
}
$exe = $distDir + "\windows\bw.exe";
$license = $rootDir + "\LICENSE.txt";
2018-05-23 20:42:46 +02:00
Copy-Item -Path $chocoDir -Destination $distChocoDir Recurse
Copy-Item $exe -Destination $distChocoToolsDir;
Copy-Item $license -Destination $distChocoToolsDir;
2018-05-23 20:42:46 +02:00
$srcPackage = $rootDir + "\package.json";
$srcPackageVersion = (Get-Content -Raw -Path $srcPackage | ConvertFrom-Json).version;
$nuspec = $distChocoDir + "\bitwarden-cli.nuspec";
choco pack $nuspec --version $srcPackageVersion --out $distChocoDir