File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+
2519Write-Host " -====="
26- Write-Host $myText
You can’t perform that action at this time.
0 commit comments