Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with globbing for BAT* when it is not present. On Ubuntu 14... #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ziegs
Copy link

@ziegs ziegs commented Nov 2, 2014

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.

… 14.04, machines without a battery don't have any BAT* devices, and zsh throws an error instead of passing an empty glob.
@edkolev
Copy link
Owner

edkolev commented Nov 3, 2014

Thanks for catching this!

I don't think that bash supports setopt localoptions. Do you think there's another solution, without using nullglob?

@JTarasovic
Copy link

I just used a quick find like so...

[ "$(find /sys/class/power_supply/ -maxdepth 0 -type d -empty 2>/dev/null)" ] && return 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants