]> apps.delaporte.us Git - dotfiles.git/commitdiff
Sprint dashboard -list and -chart flags
authorEdward Delaporte <delaport@illinois.edu>
Tue, 30 Nov 2021 22:28:31 +0000 (16:28 -0600)
committerEdward Delaporte <delaport@illinois.edu>
Tue, 30 Nov 2021 22:28:31 +0000 (16:28 -0600)
psmodules/sprint.psm1

index d891b45d99217469ddc2a26a15a05bdaac87643b..f925040a005bd6d5e4bd2486db3508caa139ec0c 100644 (file)
@@ -1,16 +1,46 @@
+
 function Show-SprintPlan(){
+    param(
+        [switch]$list = $false,
+        [switch]$chart = $false
+    )
     Write-Host "## Stats"
     $closed = Get-GHClosed
     $closed_count = ($closed | Measure-Object).Count
-    $orphans = (Get-GHNoMilestone -repository SecOps-Tools | Measure-Object -Property updated_at -Min -Max).Count
+       Add-Content -Path ~/.chart_closed -Value "|$closed_count"
+       $env:closed =  Get-Content -Path ~/.chart_closed
+
+    $orphans = Get-GHNoMilestone -repository SecOps-Tools
+    $orphans_count = ($orphans | Measure-Object -Property updated_at -Min -Max).Count
+       Add-Content -Path ~/.chart_orphans -Value "|$orphans_count"
+       $env:orphans =  Get-Content -Path ~/.chart_orphans
+
     $unsized = Get-GHUnsized
     $unsized_count = ($unsized | Measure-Object).Count
+       Add-Content -Path ~/.chart_unsized -Value "|$unsized_count"
+       $env:unsized =  Get-Content -Path ~/.chart_unsized
+
+    if($chart) {
+        chart -var "closed"
+    }
     Write-Host "Closed Issues this Sprint: $closed_count"
+    if($chart) {
+        chart -var "unsized"
+    }
     Write-Host "Count of Unsized Issues: $unsized_count"
-    Write-Host "Count of Issues with no milestone: $orphans"
-    Write-Host "## Closed Issues Updated this Sprint (Show-GHClosed)"
-    $closed | Show-GHIssuesAsMarkdown
-    Write-Host "## Unsized Issues (Show-GHUnsized)"
-    $unsized | Show-GHIssuesAsMarkdown
+    if($chart) {
+        chart -var "orphans"
+    }
+    Write-Host "Count of Issues with no milestone: $orphans_count"
+
+    if($list) {
+        Write-Host "## Closed Issues Updated this Sprint (Show-GHClosed)"
+        $closed | Show-GHIssuesAsMarkdown
+        Write-Host "## Unsized Issues (Show-GHUnsized)"
+        $unsized | Show-GHIssuesAsMarkdown
+        Write-Host "## Issues with No Milestone"
+        $orphans | Show-GHIssuesAsMarkdown
+    }
+
 }
 Export-ModuleMember -Function Show-SprintPlan
\ No newline at end of file