Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Find-TODOs {
- $lastFileName = ''
- (hg diff | ForEach-Object {
- If ($_.StartsWith('+++ ')) {
- $lastFileName = $_.TrimStart('+++ b')
- }
- If ($_.StartsWith('+') -And $_ -Like '*TODO:*' -And $_ -NotLike '*TODO: Resource*') {
- If ($lastFileName -ne '') {
- Write-Host $lastFileName
- $lastFileName = ''
- }
- Write-Host $_ -ForegroundColor Green
- }
- })
- }
- Set-Alias todo Find-TODOs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement