Added test for the "no" energy tool case

This commit is contained in:
Nils Winkler
2017-11-02 06:15:34 +01:00
parent 5ab0cc5388
commit 31990490fa
2 changed files with 17 additions and 1 deletions

View File

@@ -74,7 +74,11 @@ battery_percentage(){
COMMAND_OUTPUT="no"
fi
printf "%02d" "${COMMAND_OUTPUT:--1}"
if [ "${COMMAND_OUTPUT}" != "no" ]; then
printf "%02d" "${COMMAND_OUTPUT:--1}"
else
echo "${COMMAND_OUTPUT}"
fi
}
battery_charge(){