Commit graph

8 commits

Author SHA1 Message Date
Mislav Marohnić
ed1a3a5545
Switch back to resolving symlinks for rbenv executable (#1439)
Considerations:

- `./libexec/rbenv` executable is the entrypoint to the program;

- BASH_SOURCE might be the path to a symlink that has activated `./libexec/rbenv`;

- We must resolve the symlink to learn where rbenv's libexec directory is;

- It's not guaranteed that rbenv commands will always remain directly under their own "libexec" directory, since a package maintainer can change that, e.g. rbenv commands are sometimes placed into `/usr/libexec/rbenv/*`;

- Resolving symlinks might fail and in that case we just assume rbenv project layout.
2022-09-29 15:27:17 +02:00
Jason Karns
5ccba5d7cc Extract common create_hook helper 2016-01-04 09:14:04 -05:00
Mislav Marohnić
e554cd86c3 Strip leading : from RBENV_HOOK_PATH 2015-12-24 19:12:47 +01:00
Mislav Marohnić
825de5d2e3 Fix argument handling in main rbenv command
- Explicitly asking for help with `-h` or `--help` exits with 0 status
  and displays help on stdout.

- Not providing any arguments to rbenv results in failure status and
  displays version and help on stderr.
2015-11-19 01:52:48 +01:00
Mislav Marohnić
8f87f43e22 Fix broken version-dependent test
Broken in dcca61c0bc
2015-11-14 12:21:16 +00:00
Mislav Marohnić
632263568e Add rbenv's own rbenv.d directory to hook paths
This allows rbenv source code to ship with built-in hooks.
2014-10-19 14:35:36 +02:00
Mislav Marohnić
bf39d88d11 Add tests for rbenv PATH and RBENV_HOOK_PATH handling 2014-10-19 14:35:36 +02:00
Mislav Marohnić
bb6bccb782 tests galore 2013-03-07 15:07:32 -05:00