[WIP] remove call to external ls when loading chruby#492
[WIP] remove call to external ls when loading chruby#492kbrock wants to merge 1 commit intopostmodern:masterfrom
Conversation
when the shell does not find files to match a glob expression, the expression is left unchanged. this tests that the expression has been expanded to detect if a directory has files
|
WIP: sorry, in zsh it worked for non-existing director, or a directory with rubies, but not for a directory that was empty and zsh is complicated due to the default of blowing up when there is a bad glob running |
|
@kbrock yep, we ended up using In the 1.0.0 branch, I changed |
|
ooh, sweet! Ugh, I guess I have been living in the homebrew world and forgot about version 1.0. |
|
I've been slowly working on 1.0.0 branch where I can make breaking changes. The last feature I was trying to work on is adding a |
|
before
after
why?
I was trying to figure out ways to make nvm.sh load faster on my system.
chruby loads so much faster, and when I looked to see why, I was distracted by the call to
ls -A "$dir". It was using a builtin to list the files in the directory, but an external command to detect if there were files in the directory.So yea, I converted the already quick method to made it even faster.
~/.rubies, and a non-existent/opt/rubies.PREFIXwith a space in the name.This is yak shaving, and you probably can think up a better implementation. But it seems to work in
zshandbash.If you prefer not to introduce change (because change always introduces risk), then that is cool. Just close.
I just saw this change and wanted to share.
As you will note,
nvmis noticeably slower and the reason for my original tangent:Thanks again for such a great tool. And it already performs heads and shoulders better than other tools out there. (ruby or other)
refs: