-
Notifications
You must be signed in to change notification settings - Fork 59
/
init.ps1
30 lines (23 loc) · 997 Bytes
/
init.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
param(
$pcre="10.40"
)
$ErrorActionPreference="Stop"
$dest = "bin"
if (Test-Path $dest){
Remove-Item $dest -Recurse -Force -Confirm:$false
}
New-Item $dest -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
#####################################################################
# pcre
#####################################################################
$url = "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$($pcre)/pcre2-$($pcre).zip"
$output = "$dest\pcre-$($pcre).zip"
"Downloading pcre2 v$pcre sources" | Write-Host -ForegroundColor DarkGreen
Start-BitsTransfer -Source $url -Destination $output
"Extracting pcre2 v$pcre sources" | Write-Host -ForegroundColor DarkGreen
Expand-Archive -Path $output -DestinationPath $dest
Rename-Item -Path "$dest\pcre2-$($pcre)" -NewName "pcre2"
if(Test-Path "pcre-$($pcre).patch") {
"Applying pcre patches" | Write-Host -ForegroundColor DarkGreen
.\patch.ps1 -patch "pcre-$($pcre).patch" -path $dest\pcre2
}