fix(cli): do not create bin
folder within DENO_INSTALL_ROOT
#27459
+34
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As can be seen in the documentation,
DENO_INSTALL_ROOT
is meant to be the folder wherein Deno will install executables, with the default being$HOME/.deno/bin
.However, the current behaviour of the
install
anduninstall
commands, ifDENO_INSTALL_ROOT
is set, is to still append "bin" to the path. This leads to executables being installed in a folder like$HOME/.deno/bin/bin
, which is obviously not the intended behaviour.This commit removes this appending. Do note that this is a breaking change in the behaviour of the
--root
flag, as previously it referred to a folder wherein thebin
folder was located, but now it refers to thebin
folder itself. For example:deno install --root /foo/bar test.ts
would previously install the executable in/foo/bar/bin/test
, but now it will install it in/foo/bar/test
.This would also most certainly break many third-party tools that expect the current behaviour. See for example:
Closes #26442
Please do note that, as I am currently on a family visit out of the country, I currently only have my poor little laptop. As such, I do not have the storage capacity to build the project or run the test suite, so THIS CODE IS UNTESTED. If someone else could test it for me, that'd be grand, and otherwise I'll do it when I'm back home in a couple of weeks.