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

command and which can't be trusted when checking for gem binaries. #2

Open
lucasmazza opened this issue Jun 24, 2013 · 5 comments
Open

Comments

@lucasmazza
Copy link
Contributor

We're using command and which (older versions of the script) to check if Bundler is present, but these tricks to see if the bundle cli is present can't be trusted, thanks to Rbenv shims.

gem uninstall bundler
command -v bundle 
# /opt/boxen/rbenv/shims/bundle
bundle -v
# rbenv: bundle: command not found
# 
# The `bundle' command exists in these Ruby versions:
#   1.9.3-p194
#   1.9.3-p392
#   2.0.0-p0

I guess we need to try the good old bundle -v to check Bundler's presence here.

/cc @rondy, the one who found this issue.

@rafaelfranca
Copy link
Contributor

What is the status of command -v bundle? It should not be 0

@rafaelfranca
Copy link
Contributor

oops, status of bundle

@rmascarenhas
Copy link

That's sad, since it leads to kinda "false" bash completion. The binary is in the PATH, though not accessible.

Since that's the case, maybe a slightly better option would be relying on the exit status of rbenv which, so that we do not have to load bundler to check if it's available.

@rafaelfranca
Copy link
Contributor

Yes, 👍 for rbenv whish. I think I already did this in some project.

@lucasmazza
Copy link
Contributor Author

👍

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

No branches or pull requests

3 participants