-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update powershell scripts to match bash build scripts
- Loading branch information
1 parent
a5e5cf4
commit 2c83ad6
Showing
3 changed files
with
91 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
param( | ||
[string]$browser | ||
) | ||
|
||
$currPwd = Get-Location | ||
|
||
Set-Location $currPwd | ||
Write-Output "Moved to scripts dir" | ||
|
||
if ($browser -eq "chrome") | ||
{ | ||
Write-Output "Build chrome extension" | ||
} else | ||
{ | ||
Write-Output "Build firefox extension" | ||
} | ||
|
||
|
||
if (Test-Path -path "../build") | ||
{ | ||
$null = Remove-Item "../build" -recurse -erroraction stop | ||
Write-Output "Removed build dir" | ||
} | ||
|
||
mkdir ../build | ||
Write-Output "Created build dir" | ||
|
||
Copy-Item "../src/*" -destination "../build" -recurse -erroraction stop | ||
Write-Output "Copied Sources" | ||
|
||
Set-Location .. | ||
#build-vuecomp | ||
& "$PSScriptRoot\build-vue-comp.ps1" | ||
Write-Output "Built vue components" | ||
|
||
Set-Location scripts | ||
if ($browser -eq "chrome") | ||
{ | ||
Copy-Item "../addon/chrome/*" -destination "../build" -recurse -erroraction stop | ||
} else | ||
{ | ||
Copy-Item "../addon/firefox/*" -destination "../build" -recurse -erroraction stop | ||
} | ||
Write-Output "Copied webextension files" | ||
|
||
Write-Output "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
param ( | ||
[string]$browser | ||
) | ||
|
||
$currPwd = Get-Location | ||
|
||
if (!(Test-Path -path "../dist")) { | ||
if (!(Test-Path -path "../dist")) | ||
{ | ||
$null = mkdir "../dist" | ||
} | ||
|
||
if (Test-Path -path "../dist/resting.xpi") { | ||
if (Test-Path -path "../dist/resting.xpi") | ||
{ | ||
$null = Remove-Item "../dist/resting.xpi" | ||
} | ||
|
||
if (Test-Path -path "../dist/resting-unsigned.xpi") { | ||
if (Test-Path -path "../dist/resting-unsigned.xpi") | ||
{ | ||
$null = Remove-Item "../dist/resting-unsigned.xpi" | ||
} | ||
|
||
|
@@ -17,26 +24,40 @@ cd .. | |
& "$PSScriptRoot\build-vue-comp.ps1" | ||
echo "vue components built" | ||
|
||
cd "src" | ||
if (!(Test-Path -path "dist/tmp")) | ||
{ | ||
$null = mkdir "dist/tmp" | ||
} | ||
|
||
if ($browser -eq "chrome") | ||
{ | ||
cp addon/chrome/* dist/tmp | ||
echo "copy chrome manifest" | ||
} else | ||
{ | ||
cp addon/firefox/* dist/tmp | ||
echo "copy firefox manifest" | ||
} | ||
|
||
cd src | ||
try | ||
{ | ||
Copy-Item "./" -destination "../dist/tmp" -recurse -erroraction stop | ||
Copy-Item "./" -destination "../dist/tmp" -recurse -erroraction SilentlyContinue | ||
echo "created tmp folder" | ||
echo "copy src in tmp folder" | ||
} | ||
catch | ||
} catch | ||
{ | ||
echo "error copying src folder" | ||
exit -1 | ||
} | ||
|
||
try { | ||
(Get-Content "./manifest.json" -erroraction stop) -replace "^}", ',"applications": {"gecko": {"id": "[email protected]"}}}' | | ||
Set-Content "../dist/tmp/manifest.json" -erroraction stop | ||
try | ||
{ | ||
(Get-Content "../dist/tmp/manifest.json" -erroraction stop) -replace "^}", ',"applications": {"gecko": {"id": "[email protected]"}}}' | | ||
Set-Content "../dist/tmp/manifest.json" -erroraction stop | ||
echo "editing manifest.json" | ||
} | ||
catch { | ||
} catch | ||
{ | ||
echo "error editing manifest" | ||
exit -1 | ||
} | ||
|
@@ -48,20 +69,24 @@ echo "move to folder $getPwd" | |
Compress-Archive -path * -destinationpath "../resting-unsigned.xpi" | ||
|
||
cd "../.." | ||
try { | ||
try | ||
{ | ||
Compress-Archive -path "./README.md","./LICENSE" -update -destinationpath "./dist/resting-unsigned.xpi" -erroraction stop | ||
echo "creating xpi file" | ||
} | ||
catch { | ||
} catch | ||
{ | ||
echo "error creating xpi file" | ||
} | ||
|
||
try { | ||
try | ||
{ | ||
Remove-Item ".\dist\tmp\" -recurse -erroraction stop | ||
echo "delete tmp folder" | ||
} | ||
catch { | ||
} catch | ||
{ | ||
echo "error deleting tmp folder" | ||
} | ||
|
||
cd $currPwd | ||
cd $currPwd | ||
|
||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters