From 4f1dfa160258684f158afd56b080ecccc46a74aa Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 26 Aug 2019 15:24:25 -0400 Subject: [PATCH] build safari appex script fixes --- scripts/build-safari-appex.ps1 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/build-safari-appex.ps1 b/scripts/build-safari-appex.ps1 index 27231cd3cf..0ac780e715 100644 --- a/scripts/build-safari-appex.ps1 +++ b/scripts/build-safari-appex.ps1 @@ -1,5 +1,4 @@ param ( - [Parameter(Mandatory=$true)] [string] $version ) @@ -13,14 +12,27 @@ $dir = Split-Path -Parent $MyInvocation.MyCommand.Path; $rootDir = $dir + "\.."; $distDir = $rootDir + "\dist"; $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"; +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 cd $distSafariDir -git clone https://github.com/bitwarden/browser.github +git clone git@github.com:bitwarden/browser.git cd browser -git checkout tags/$version + +if (-not ([string]::IsNullOrEmpty($version))) { + $tag = "v" + $version + git checkout tags/$tag +} + npm i npm run dist:safari Copy-Item -Path $distSafariAppex -Destination $pluginsAppex