Added an additional test case and a fix for using the pmset command

The other commands still need to be mocked and tested/fixed, too.
This commit is contained in:
Nils Winkler
2017-10-18 18:19:53 +02:00
parent ef28b2788b
commit d0b3205de0
2 changed files with 16 additions and 1 deletions

View File

@@ -92,7 +92,13 @@ battery_percentage(){
echo '100'
;;
*)
echo $PMSET_OUTPUT | head -c 2
# This will cut off any decimals, and will get rid of the optional percentage sign at the end, too.
# Works for:
# - 100%
# - 100.0%
# - 99.8%
# - 4%
echo $PMSET_OUTPUT | grep -o "[0-9]\+" | head -1
;;
esac
elif _command_exists ioreg;