1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-12 01:48:21 +02:00

allow version param

This commit is contained in:
Kyle Spearrin 2018-07-27 09:22:55 -04:00
parent ca08262cd8
commit 56395ede45

View File

@ -1,8 +1,13 @@
# Dependencies:
param (
[Parameter(Mandatory=$true)]
[string] $version
)
# Dependencies:
# 1. Install powershell, ex `sudo apt-get install -y powershell`
#
# To run:
# ./snap-build.ps1
# ./snap-build.ps1 -version 1.1.0
#
# and then push to snap with:
# cd ../dist/snap
@ -15,14 +20,12 @@ $distDir = $rootDir + "/dist"
$snapDir = $rootDir + "/stores/snap"
$distSnapDir = $distDir + "/snap"
$snapDistYaml = $distSnapDir + "/snapcraft.yaml"
$srcPackage = $rootDir + "/package.json"
$srcPackageVersion = (Get-Content -Raw -Path $srcPackage | ConvertFrom-Json).version
if(Test-Path -Path $distSnapDir) {
Remove-Item -Recurse -Force $distSnapDir
}
Copy-Item -Path $snapDir -Destination $distSnapDir Recurse
(Get-Content $snapDistYaml).replace('__version__', $srcPackageVersion) | Set-Content $snapDistYaml
(Get-Content $snapDistYaml).replace('__version__', $version) | Set-Content $snapDistYaml
cd $distSnapDir
snapcraft