Skip to content

Commit

Permalink
Replaced PrBodyContentReply `n with array (microsoft#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficialEsco authored Aug 12, 2021
1 parent cd3b0a3 commit 097e2c7
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Tools/YamlCreate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"] -HelpText $_menu["HelpText"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}

Expand All @@ -896,14 +896,14 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"] -HelpText $_menu["HelpText"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}

'*winget validate*' {
if ($?) {
$PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n"
$PrBodyContentReply += @($_line.Replace("[ ]", "[X]"))
}
else {
$_menu = @{
Expand All @@ -915,15 +915,15 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"] -HelpText $_menu["HelpText"] -HelpTextColor $_menu["HelpTextColor"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}
}

'*tested your manifest*' {
if ($script:SandboxTest -eq '0') {
$PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n"
$PrBodyContentReply += @($_line.Replace("[ ]", "[X]"))
}
else {
$_menu = @{
Expand All @@ -934,8 +934,8 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"] -HelpText $_menu["HelpText"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}
}
Expand All @@ -949,8 +949,8 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"] -HelpText $_menu["HelpText"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}

Expand All @@ -962,8 +962,8 @@ Function Enter-PR-Parameters {
}

switch ( KeypressMenu -Prompt $_menu["Prompt"] -Entries $_menu["Entries"] -DefaultString $_menu["DefaultString"]) {
'Y' { $PrBodyContentReply += $_line.Replace("[ ]", "[X]"), "`n" }
default { $PrBodyContentReply += $_line, "`n" }
'Y' { $PrBodyContentReply += @($_line.Replace("[ ]", "[X]")) }
default { $PrBodyContentReply += @($_line) }
}
}
}
Expand All @@ -980,14 +980,14 @@ Function Enter-PR-Parameters {
Write-Host
Write-Host "Enter issue number. For example`: 21983, 43509"
$ResolvedIssues = Read-Host -Prompt 'Resolved Issues'
$PrBodyContentReply += @("")
Foreach ($i in ($ResolvedIssues.Split(",").Trim())) {
$PrBodyContentReply += "Resolves #$i`n"
$PrBodyContentReply += @("Resolves #$i")
}
}
default { Write-Host }
}

$PrBodyContentReply = ($PrBodyContentReply.Trim() -ne '')
Set-Content -Path PrBodyFile -Value $PrBodyContentReply | Out-Null
gh pr create --body-file PrBodyFile -f
Remove-Item PrBodyFile
Expand Down

0 comments on commit 097e2c7

Please sign in to comment.