-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
follow links #869
follow links #869
Conversation
index.js
Outdated
@@ -8,6 +8,7 @@ var path = require('path'); | |||
var dirname = path.dirname; | |||
var basename = path.basename; | |||
var fs = require('fs'); | |||
var readlink = require('readlink'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please inline the synchronous part of the readlink
module; as module itself introduces an async
module which is unnecessary for the commander and only introduce a ton of unused kb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that CTRL+C/CTRL+V code from readlink
is good idea, because we must also provide tests and support this legacy code. If you don't like async
module maybe better send PR to readlink
repo to remove it from dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there! Sorry me make you waiting for so long. Can you, please, fix outlined part in the review comments.
Whether to introduce dependencies is a tricky question. I'm still thinking about the tradeoffs so won't offer an opinion at this time, just add some size info.
|
fixed in #935 |
Thanks @KillWolfVlad |
yarn ~v1.10.x changed bin linking for global packages (I can't find commit with that changes).
How yarn link bin after
$ yarn global add package
?But
commander.js
read link only once time. And sub-commands not work, because in directory~/.config/yarn/global/node_modules/.bin
other files doesn't exists.My solution: follow links and get real file name.
In GNU/Linux shell command
readlink -f
implements it:For Node.js I found package readlink with almost similar behavior (from description).
Close #866