8cfc7d66774e12c8502b63ed0c48f3a216c33acf

Author
James Seward <james@jamesoff.net>
Committer
James Seward <james@jamesoff.net>
Date

Message

Prevent errors in prompts if no info available.
Define empty functions instead of none at all if we can't figure out the
platform.

Diff

 1diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
 2index 66bf46d138d5f6cedf8991239f4e9e9273d52095..9f053383a7afbb560742ff3c338dbf77d282d658 100644
 3--- a/plugins/battery/battery.plugin.zsh
 4+++ b/plugins/battery/battery.plugin.zsh
 5@@ -79,4 +79,14 @@ elif [[ $(uname) == "Linux"  ]] ; then
 6       echo "∞"
 7     fi
 8   }
 9+else
10+	# Empty functions so we don't cause errors in prompts
11+	function battery_pct_remaining() {
12+	}
13+
14+	function battery_time_remaining() {
15+	}
16+
17+	function battery_pct_prompt() {
18+	}
19 fi