2018-06-04 22:59:57 +02:00
|
|
|
|
param (
|
2018-06-05 03:38:17 +02:00
|
|
|
|
[switch] $nopush
|
2018-06-04 22:59:57 +02:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# To run:
|
2018-06-04 21:43:42 +02:00
|
|
|
|
# .\choco-update.ps1
|
2018-05-23 20:42:46 +02:00
|
|
|
|
|
|
|
|
|
$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";
|
2018-05-23 21:19:20 +02:00
|
|
|
|
$license = $rootDir + "\LICENSE.txt";
|
2018-05-23 20:42:46 +02:00
|
|
|
|
Copy-Item -Path $chocoDir -Destination $distChocoDir –Recurse
|
|
|
|
|
Copy-Item $exe -Destination $distChocoToolsDir;
|
2018-05-23 21:19:20 +02:00
|
|
|
|
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
|
2018-06-04 22:59:57 +02:00
|
|
|
|
|
|
|
|
|
if (!$nopush) {
|
|
|
|
|
cd $distChocoDir
|
|
|
|
|
choco push
|
|
|
|
|
cd $rootDir
|
|
|
|
|
}
|