-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
dash does not refresh its hash table when PATH is re-declared #706
Comments
More documentation:
The Open Group docs for hash say this, which is probably why I went for
|
That is true of Bash’s implementation of [Edited to add more context.] |
Yes "portably" is not universally. 🙊 |
After some experimentation...
|
Oh, wow. So how about I modify my PR thusly:
|
I am disappointed with Moving the command to the front to make it easier to spot, how about:
|
Agreed, that’s much better. I’ll update my PR with that here shortly! |
@shadowspawn All done! PR is ready for review at your leisure. |
Improvements included in |
The following line recommends re-declaring
PATH
to ensure the new location of Node.js is loaded in the current session.n/bin/n
Line 744 in d569e33
However, in some environments that might not suffice. I ran into this issue on Platform.sh, which uses
dash
. Interestingly enough, after installing Node withn auto
(our project has an.nvmrc
file specifying v14), runningwhich node
points to the location where we toldn
to install Node:/app/.global/bin/node
. However, runningnode --version
yielded v12. Simply invokingexport PATH="$PATH"
did not solve this issue.As it turns out, dash’s implementation of the
hash
built-in command does not refresh the hash table where executables are stored for easy access. The fix suggested to us by Platform.sh support was to invokehash -r
instead. This worked: after invoking that,node --version
yielded the version number we expect (the one installed vian
).I will submit a PR shortly that updates the line linked above to include a note about how to solve this issue in dash.
The text was updated successfully, but these errors were encountered: