From 8cfc7d66774e12c8502b63ed0c48f3a216c33acf Mon Sep 17 00:00:00 2001 From: James Seward Date: Mon, 4 Nov 2013 21:00:11 -0500 Subject: [PATCH] Prevent errors in prompts if no info available. Define empty functions instead of none at all if we can't figure out the platform. --- plugins/battery/battery.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 66bf46d13..9f053383a 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -79,4 +79,14 @@ elif [[ $(uname) == "Linux" ]] ; then echo "∞" fi } +else + # Empty functions so we don't cause errors in prompts + function battery_pct_remaining() { + } + + function battery_time_remaining() { + } + + function battery_pct_prompt() { + } fi