Skip to content

Commit 2cada88

Browse files
committed
creating zip
1 parent e3a1946 commit 2cada88

2 files changed

Lines changed: 17 additions & 22 deletions

File tree

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ steps:
2121
cd NetCore2Blockly
2222
dotnet tool restore
2323
pwsh ./setVersion.ps1
24+
pwsh ./createHTML.ps1
25+
copy ./TestBlocklyHtml/wwwroot/blocklyNetCore.zip $(Build.ArtifactStagingDirectory)\blockly.zip
2426
dotnet build --configuration $(buildConfiguration) NetCore2Blockly.sln /m:1
2527
displayName: build sln
2628

src/NetCore2Blockly/createHTML.ps1

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1+
$folder= ".\TestBlocklyHtml\wwwroot"
2+
$fileContent = Get-Content "$folder\blockly.html"
13

2-
function GetStringBetweenTwoStrings($firstString, $secondString, $importPath){
3-
4-
#Get content from file
5-
$file = Get-Content $importPath
6-
Write-Host $file
7-
#$file = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
8-
#Regex pattern to compare two strings
9-
[regex]$regex =
10-
@'
11-
(?ms)doNotCopy:
12-
(.+?)
13-
endDoNotCopy:.+?
14-
'@;
15-
$regex.Matches("$(Get-Content $importPath -Raw)") |
16-
foreach { $_.groups[1].value }{
17-
Write-Host $_
18-
}
19-
#Return result
20-
return 10
4+
$fileContent = $fileContent.Replace('<!--doNotCopyToFinal-->','<!--')
5+
$fileContent = $fileContent.Replace('<!--enddoNotCopyToFinal-->','-->')
6+
$fileContent = $fileContent.Replace('/*doNotCopyToFinal*/','/*')
7+
$fileContent = $fileContent.Replace('/*enddoNotCopyToFinal*/','*/')
218

9+
Out-File -InputObject $fileContent -FilePath ".\TestBlocklyHtml\wwwroot\blockly.html"
10+
$zipFile = "$folder\blocklyNetCore.zip"
11+
$compress = @{
12+
Path = "$Folder"
13+
CompressionLevel = "Fastest"
14+
DestinationPath = $zipFile
2215
}
23-
$myText =GetStringBetweenTwoStrings -firstString 'doNotCopy' -secondString 'endDoNotCopy' -importPath ".\TestBlocklyHtml\wwwroot\blockly.html"
24-
$myText =GetStringBetweenTwoStrings -firstString 'Lorem' -secondString 'is' -importPath ".\TestBlocklyHtml\wwwroot\blockly.html"
16+
Compress-Archive @compress
17+
18+
2519
Write-Host "-====="
26-
Write-Host $myText

0 commit comments

Comments
 (0)