I don't like side effects
configure_find_command() { if command -v rg >/dev/null; then echo "rg --files --iglob readme --iglob readme.md --iglob readme.txt" return fi echo "find . -type f -iname readme -o -iname readme.md -o -iname readme.txt" } find_command="$(configure_find_command)"
Do you mean you don't want it to do the fuzzy selection or launch an editor? If so, it's not particularly worth it as a script, is it?
EDIT: oh wait, I misread. You mean you don't like me futzing with global variables. That's valid.
Yes, I mean global variables.
Though exit will bomb out of the script, and should be return. I might re-work this script later.
exit
return
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't like side effects
Do you mean you don't want it to do the fuzzy selection or launch an editor? If so, it's not particularly worth it as a script, is it?
EDIT: oh wait, I misread. You mean you don't like me futzing with global variables. That's valid.
Yes, I mean global variables.
Though
exitwill bomb out of the script, and should bereturn. I might re-work this script later.