mirror of
https://github.com/bitwarden/browser
synced 2025-01-04 14:22:50 +01:00
allow version param
This commit is contained in:
parent
ca08262cd8
commit
56395ede45
@ -1,8 +1,13 @@
|
|||||||
# Dependencies:
|
param (
|
||||||
|
[Parameter(Mandatory=$true)]
|
||||||
|
[string] $version
|
||||||
|
)
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
# 1. Install powershell, ex `sudo apt-get install -y powershell`
|
# 1. Install powershell, ex `sudo apt-get install -y powershell`
|
||||||
#
|
#
|
||||||
# To run:
|
# To run:
|
||||||
# ./snap-build.ps1
|
# ./snap-build.ps1 -version 1.1.0
|
||||||
#
|
#
|
||||||
# and then push to snap with:
|
# and then push to snap with:
|
||||||
# cd ../dist/snap
|
# cd ../dist/snap
|
||||||
@ -15,14 +20,12 @@ $distDir = $rootDir + "/dist"
|
|||||||
$snapDir = $rootDir + "/stores/snap"
|
$snapDir = $rootDir + "/stores/snap"
|
||||||
$distSnapDir = $distDir + "/snap"
|
$distSnapDir = $distDir + "/snap"
|
||||||
$snapDistYaml = $distSnapDir + "/snapcraft.yaml"
|
$snapDistYaml = $distSnapDir + "/snapcraft.yaml"
|
||||||
$srcPackage = $rootDir + "/package.json"
|
|
||||||
$srcPackageVersion = (Get-Content -Raw -Path $srcPackage | ConvertFrom-Json).version
|
|
||||||
|
|
||||||
if(Test-Path -Path $distSnapDir) {
|
if(Test-Path -Path $distSnapDir) {
|
||||||
Remove-Item -Recurse -Force $distSnapDir
|
Remove-Item -Recurse -Force $distSnapDir
|
||||||
}
|
}
|
||||||
|
|
||||||
Copy-Item -Path $snapDir -Destination $distSnapDir –Recurse
|
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
|
cd $distSnapDir
|
||||||
snapcraft
|
snapcraft
|
||||||
|
Loading…
Reference in New Issue
Block a user