diff --git a/scripts/build-safari-appex.ps1 b/scripts/build-safari-appex.ps1 index 27231cd3..0ac780e7 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