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