]> apps.delaporte.us Git - dotfiles.git/blob - psmodules/dash.psm1
Add more repos
[dotfiles.git] / psmodules / dash.psm1
1 function Get-JournalAgenda() {
2 agenda.exe -path "$HOME/Journal/{YYYY}/{MM}-{DD}.md"
3 }
4
5 function Measure-JournalTodos() {
6 $todocount = todolist | Measure-Object -Line
7 $env:todocount += '|'
8 $env:todocount += $todocount.lines
9 }
10
11
12 <#
13
14 .EXAMPLE
15
16 Get-CommitsSince -From 2023.01.01
17
18 #>
19 function Show-GitRevList() {
20 param(
21 [string]$from
22 )
23 Invoke-AgileCmd "git rev-list HEAD --count --since=$from"
24 }
25
26 Export-ModuleMember -Function Show-GitRevList
27
28
29
30 <#
31
32 .SYNOPSIS
33
34 Show a text dashboard.
35
36 .EXAMPLE
37
38 Include `Todo` list.
39 Show-MyDashboard -todo
40
41 #>
42 function Show-MyDashBoard() {
43 param(
44 # [switch]$todocount=$true,
45 # [switch]$agenda,
46 [switch]$blocked,
47 [switch]$bugs,
48 [switch]$gitHub,
49 [switch]$help,
50 [switch]$leeroy,
51 [switch]$orphans,
52 [switch]$pr,
53 [switch]$requested,
54 [switch]$todo
55 )
56 $todocount = $true
57 if($todocount){
58 Measure-JournalTodos
59 Write-Host ""
60 Write-Host "## Todo items for today: $env:todocount"
61 chart -var todocount
62 }
63 $agenda = $true
64 if($agenda){
65 Write-Host ""
66 Write-Host "## Agenda for today:"
67 Get-JournalAgenda
68 }
69 if($blocked){
70 Write-Host ""
71 Write-Host "## Blocked & Blocker Issues:"
72 $blockerQuery = "label:blocker,blight,bug,blocked"
73 Invoke-AgileCmd "gh issue list -S '$blockerQuery'"
74 Write-Host ""
75 Write-Host "## Open Questions"
76 $questionQuery = 'label:"phone a friend",question,"needs context"'
77 Invoke-AgileCmd "gh issue list -S '$questionQuery'"
78
79 }
80 if($bugs) {
81 Write-Host ""
82 Write-Host "## Known Bugs"
83 Invoke-AgileCmd "gh issue list -S 'label:bug'"
84 }
85 if($github) {
86 Write-Host ""
87 Write-Host "## GitHub Status (gh status)"
88 Invoke-Expression "gh status"
89 }
90 if($help) {
91 Write-Host "## Dasbhoard Help"
92 Get-Help Show-MyDashboard
93 }
94 if($leeroy){
95 Write-Host ""
96 Write-Host "## Leeroy Jenkins!:"
97 Invoke-AgileCmd "gh issue list -l 'leeroy jenkins'"
98 }
99 if($orphans) {
100 Write-Host ""
101 Write-Host "## Issues with No Milestone"
102 Invoke-AgileCmd "gh issue list -S 'is:open is:issue no:milestone'"
103 }
104 if($pr) {
105 Write-Host ""
106 Write-Host "## Open Pull Requests"
107 Invoke-AgileCmd "gh pr list"
108 }
109 if($requested){
110 Write-Host ""
111 Write-Host "## Open Stakeholder Requests"
112 invoke-agilecmd "gh issue list -S 'label:requested'"
113 }
114 if($todo) {
115 Write-Host ""
116 Write-Host "## Journal Todo Items"
117 todolist
118 Write-Host ""
119 Write-Host "## Todo.txt File"
120 todotxt
121 }
122 }
123
124 function Write-AgileClosedData() {
125 $gh_cmd = 'gh issue list --state closed --json title,closedAt,milestone,url'
126 Write-AgileToFile -gh_command $gh_cmd
127 }
128
129 Export-ModuleMember -Function Write-AgileClosedData
130 Export-ModuleMember -Function Show-MyDashboard
131 Export-ModuleMember -Function Show-MyTeamWork