mirror of https://github.com/bitwarden/cli.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
728 B
24 lines
728 B
# 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
|
|
|