Skip to content

Commit f40960c

Browse files
committed
Checked for empty files
1 parent f04cd42 commit f40960c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/ImportExamples.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Start-Generator {
2424
)
2525

2626
$GraphMapping = @{
27-
"v1.0" = "v1.0\examples"
27+
# "v1.0" = "v1.0\examples"
2828
"beta" = "beta\examples"
2929
}
3030
if ($GenerationMode -eq "auto") {
@@ -370,6 +370,7 @@ function Update-ExampleFile {
370370

371371
}
372372
$CheckIfFileEmpty = Test-FileEmpty $ExampleFile
373+
Write-Host $ExampleFile
373374
if($CheckIfFileEmpty){
374375
Retain-ExistingCorrectExamples -Content $Content -File $ExampleFile
375376
}
@@ -440,7 +441,7 @@ function Retain-ExistingCorrectExamples {
440441

441442
$CorrectMaintainableHeaderCount = 1;
442443
$LineCounter = 0;
443-
444+
if($Content.Count -gt 0){
444445
foreach($Line in $Content){
445446

446447
if($Line.StartsWith("$CommandPattern ")){
@@ -455,6 +456,7 @@ function Retain-ExistingCorrectExamples {
455456
}
456457

457458
}
459+
}
458460

459461
}
460462
$JsonContent = Get-Content -Path $MetaDataJsonFile

0 commit comments

Comments
 (0)