mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-10-31 16:06:36 +00:00 
			
		
		
		
	Properly handle 'All caught up!' output from gh-notify
This commit is contained in:
		
							parent
							
								
									ed1487a251
								
							
						
					
					
						commit
						f8f96d4dd7
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -190,6 +190,12 @@ send_notify() { | |||
| # Request unread notifications with gh-notify extension for github-cli | ||||
| [ "$ALL" -eq 1 ] && out="$(gh notify -s -a -n "$MAX_AMOUNT")" || out="$(gh notify -s -n "$MAX_AMOUNT")" | ||||
| 
 | ||||
| # When no notifications were found, set output to empty string, to avoid 'All caught up!' line  | ||||
| # being treated as notification | ||||
| if [ "$out" == "All caught up!" ]; then | ||||
|     out="" | ||||
| fi | ||||
| 
 | ||||
| total="$(printf "%s\n" "$out" | wc -l)" | ||||
| # Since we always end with a newline (to count the last entry as a line), we always get | ||||
| # at least 1 as a total here, even if $out is empty. If we didn't use the \n, we'd always | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue