1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-02 08:40:08 +01:00
bitwarden-browser/scripts/safari-build.ps1
2019-09-30 09:29:12 -04:00

40 lines
941 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

param (
[string] $version
)
# Dependencies:
# 1. brew cask install powershell
#
# To run:
# pwsh ./build-safari-appex.ps1 -version 1.41.0
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path;
$rootDir = $dir + "\..";
$distDir = $rootDir + "\dist";
$distSafariDir = $distDir + "\safari";
$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 git@github.com:bitwarden/browser.git
cd browser
if(-not ([string]::IsNullOrEmpty($version))) {
$tag = "v" + $version
git checkout tags/$tag
}
npm i
npm run dist:safari
Copy-Item -Path $distSafariAppex -Destination $pluginsAppex Recurse
cd $rootDir