Fix Gitea wrapper login resolution (#538)
This commit was merged in pull request #538.
This commit is contained in:
@@ -58,12 +58,17 @@ switch ($platform) {
|
||||
& $cmd[0] $cmd[1..($cmd.Length-1)]
|
||||
}
|
||||
"gitea" {
|
||||
$repoArgs = @(Get-GiteaRepoArgs)
|
||||
if ($repoArgs.Length -eq 0) {
|
||||
Write-Error "Could not resolve Gitea repo/login for remote host"
|
||||
exit 1
|
||||
}
|
||||
$cmd = @("tea", "issue", "create", "--title", $Title)
|
||||
if ($Body) { $cmd += @("--description", $Body) }
|
||||
if ($Labels) { $cmd += @("--labels", $Labels) }
|
||||
if ($Milestone) {
|
||||
# Try to get milestone ID by name
|
||||
$milestoneList = tea milestones list 2>$null
|
||||
$milestoneList = tea milestones list @repoArgs 2>$null
|
||||
$milestoneId = ($milestoneList | Select-String "^\s*(\d+).*$Milestone" | ForEach-Object { $_.Matches.Groups[1].Value } | Select-Object -First 1)
|
||||
if ($milestoneId) {
|
||||
$cmd += @("--milestone", $milestoneId)
|
||||
@@ -71,6 +76,7 @@ switch ($platform) {
|
||||
Write-Warning "Could not find milestone '$Milestone', creating without milestone"
|
||||
}
|
||||
}
|
||||
$cmd += $repoArgs
|
||||
& $cmd[0] $cmd[1..($cmd.Length-1)]
|
||||
}
|
||||
default {
|
||||
|
||||
Reference in New Issue
Block a user