bitwarden-estensione-browser/scripts/snap-build.ps1

29 lines
850 B
PowerShell
Raw Normal View History

2018-07-27 15:05:16 +02:00
# Dependencies:
# 1. Install powershell, ex `sudo apt-get install -y powershell`
#
# To run:
2018-05-25 20:51:30 +02:00
# ./snap-build.ps1
#
# and then push to snap with:
# cd ../dist/snap
# snap push bw*.snap
2018-07-27 15:05:16 +02:00
# or, use the ./snap-update.ps1 script
2018-05-25 20:51:30 +02:00
$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