aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-01-16 05:53:42 +0300
committerBen Hilburn <bhilburn@gmail.com>2016-01-16 05:53:42 +0300
commit817cdf98a14364b8ed257f017c82036ec570ced2 (patch)
tree3dcce84c33f7c3aa5282d705d2d4e7328df6c5b4 /powerlevel9k.zsh-theme
parent4d25fd5dc38f80895814118323842d15025f3ae6 (diff)
parent6f2f78b21fe597ad55e5f87360b68b4a812a7d19 (diff)
Merge pull request #191 from rjorgenson/next
added check for nvm command before running
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme3
1 files changed, 2 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index c3b12759..a79548a5 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -312,7 +312,7 @@ prompt_battery() {
if [[ $OS =~ OSX && -f /usr/sbin/ioreg && -x /usr/sbin/ioreg ]]; then
# Pre-Grep as much information as possible to save some memory and
# avoid pollution of the xtrace output.
- local raw_data=$(ioreg -n AppleSmartBattery | grep -E "MaxCapacity|TimeRemaining|CurrentCapacity|ExternalConnected|IsCharging")
+ local raw_data="$(ioreg -n AppleSmartBattery | grep -E "MaxCapacity|TimeRemaining|CurrentCapacity|ExternalConnected|IsCharging")"
# return if there is no battery on system
[[ -z $(echo $raw_data | grep MaxCapacity) ]] && return
@@ -533,6 +533,7 @@ prompt_node_version() {
# Node version from NVM
# Only prints the segment if different than the default value
prompt_nvm() {
+ [[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return
local node_version=$(nvm current)
local nvm_default=$(cat $NVM_DIR/alias/default)
[[ -z "${node_version}" ]] && return