From 8d151e8f73859863a869a298f6b67b7902258541 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 f04fd10e4..fa1ae6673 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -83,4 +83,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