build safari appex script fixes

This commit is contained in:
Kyle Spearrin 2019-08-26 15:24:25 -04:00
parent 244b5d258b
commit 4f1dfa1602
1 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,4 @@
param ( param (
[Parameter(Mandatory=$true)]
[string] $version [string] $version
) )
@ -13,14 +12,27 @@ $dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\.."; $rootDir = $dir + "\..";
$distDir = $rootDir + "\dist"; $distDir = $rootDir + "\dist";
$distSafariDir = $distDir + "\safari"; $distSafariDir = $distDir + "\safari";
$distSafariAppex = $distSafariDir + "\src\dist\Safari\build\Release\safari.appex"; $distSafariAppex = $distSafariDir + "\browser\dist\Safari\build\Release\safari.appex";
$pluginsAppex = $rootDir + "\PlugIns\safari.appex"; $pluginsAppex = $rootDir + "\PlugIns\safari.appex";
if(Test-Path -Path $distSafariDir) {
Remove-Item -Recurse -Force $distSafariDir
}
if(Test-Path -Path $pluginsAppex) {
Remove-Item -Recurse -Force $pluginsAppex
}
New-Item $distSafariDir -ItemType Directory -ea 0 New-Item $distSafariDir -ItemType Directory -ea 0
cd $distSafariDir cd $distSafariDir
git clone https://github.com/bitwarden/browser.github git clone git@github.com:bitwarden/browser.git
cd browser cd browser
git checkout tags/$version
if (-not ([string]::IsNullOrEmpty($version))) {
$tag = "v" + $version
git checkout tags/$tag
}
npm i npm i
npm run dist:safari npm run dist:safari
Copy-Item -Path $distSafariAppex -Destination $pluginsAppex Copy-Item -Path $distSafariAppex -Destination $pluginsAppex