File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -83,21 +83,24 @@ function Ask-IncludeAPI {
83
83
Write-Host " "
84
84
Write-Host - ForegroundColor Cyan " Do you want to include API?"
85
85
Write-Host " "
86
- Write-Host - ForegroundColor Yellow " [Y] Yes"
86
+ Write-Host - ForegroundColor Yellow " [Y] Yes or ENTER "
87
87
Write-Host - ForegroundColor Yellow " [N] No"
88
88
Write-Host " "
89
89
90
- return (Read-Host - Prompt " Your choice (Y/N)" ).ToLower() -eq " y"
90
+ $input = Read-Host - Prompt " Your choice [Y, N, or ENTER (default is Y)]"
91
+
92
+ return ($input -eq " Y" -or $input -eq " y" -or $input -eq " " )
91
93
}
92
94
93
95
function Ask-UseExistingAPI {
94
96
Write-Host " "
95
97
Write-Host - ForegroundColor Cyan " Do you want to use already generated API metadata?"
96
98
Write-Host " "
97
- Write-Host - ForegroundColor Yellow " [Y] Yes"
99
+ Write-Host - ForegroundColor Yellow " [Y] Yes or ENTER "
98
100
Write-Host - ForegroundColor Yellow " [N] No"
99
101
Write-Host " "
100
102
103
+ $input = Read-Host - Prompt " Your choice [Y, N, or ENTER (default is Y)]"
101
104
return (Read-Host - Prompt " Your choice (Y/N)" ).ToLower() -eq " y"
102
105
}
103
106
@@ -446,10 +449,16 @@ else {
446
449
{
447
450
$API = Ask- IncludeAPI
448
451
449
- if ($API ) {
450
- $ReuseAPI = Ask- UseExistingAPI
451
- }
452
+ if ($API )
453
+ {
454
+ # Check for .yml files
455
+ $ymlFiles = Get-ChildItem - Path " en/api/" - Filter " *.yml"
452
456
457
+ if ($ymlFiles.Count -gt 0 )
458
+ {
459
+ $ReuseAPI = Ask- UseExistingAPI
460
+ }
461
+ }
453
462
} elseif ($isCanceled ) {
454
463
Write-Host - ForegroundColor Red " Operation canceled by user."
455
464
Stop-Transcript
You can’t perform that action at this time.
0 commit comments