Open ziegs opened 10 years ago
Thanks for catching this!
I don't think that bash supports setopt localoptions
. Do you think there's another solution, without using nullglob
?
I just used a quick find like so...
[ "$(find /sys/class/power_supply/ -maxdepth 0 -type d -empty 2>/dev/null)" ] && return 1
Fix an issue with globbing for BAT* when it is not present. On Ubuntu 14.04, machines without a battery don't have any BAT* devices, and zsh throws an error instead of passing an empty glob. http://zshwiki.org/home/options/expn has documentation for the null_glob option.
Prior to this change, machines without a battery print
__promptline_battery:27: no matches found: /sys/class/power_supply/BAT*
before each prompt.