1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-17 14:06:49 +02:00
bitwarden-browser/scripts/snap-build.ps1
2018-05-25 14:54:00 -04:00

25 lines
728 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.

# To run:
# ./snap-build.ps1
#
# and then push to snap with:
# cd ../dist/snap
# snap push bw*.snap
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
$rootDir = $dir + "/.."
$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
cd $distSnapDir
snapcraft