Output empty lines for no results and no longer escape ampersands.
This commit is contained in:
		
							parent
							
								
									6baf532b42
								
							
						
					
					
						commit
						76a34e4d9c
					
				| 
						 | 
					@ -8,4 +8,6 @@ count=$(echo $json | jq -j '.unreads | length')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ ! $count -eq "0" ]]; then
 | 
					if [[ ! $count -eq "0" ]]; then
 | 
				
			||||||
  echo $count
 | 
					  echo $count
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  echo
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -101,7 +101,9 @@ async function getStatus(): Promise<Status> {
 | 
				
			||||||
async function getCurrentSong(): Promise<void> {
 | 
					async function getCurrentSong(): Promise<void> {
 | 
				
			||||||
  const status = await getStatus();
 | 
					  const status = await getStatus();
 | 
				
			||||||
  if (status.status === "playing") {
 | 
					  if (status.status === "playing") {
 | 
				
			||||||
    console.log(`${status.artist} - ${status.title}`.replaceAll("&", "&"));
 | 
					    console.log(`${status.artist} - ${status.title}`);
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    console.log("");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue