Skip to content

rbenv users? #1525

Answered by mislav
huyz asked this question in Q&A
Sep 16, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I'm not aware of such a plugin existing, but it's a cool use case!

Here's a one-liner that could answer a question about which projects within the ~/Projects directory currently uses the 2.7.0 Ruby version:

find ~/Projects -name '.ruby-version' -exec grep -qF 2.7.0 '{}' \; -print

Explanation:

  • find searches for files named .ruby-version under a given starting path (~/Projects);
  • for each found file, match its contents against the literal string 2.7.0;
  • the {} and \; bits might look confusing, but are explained in man find under the -exec section;
  • print all matches.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@huyz
Comment options

Answer selected by huyz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants