-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
commands/boostrap: use new cmds #5678
Conversation
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.
Seems to make tests fail: https://ci.ipfs.team/blue/organizations/jenkins/IPFS%2Fgo-ipfs/detail/PR-5678/2/tests
core/commands/bootstrap.go
Outdated
} | ||
|
||
r, err := fsrepo.Open(req.InvocContext().ConfigRoot) | ||
ctx := env.(*oldcmds.Context) |
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.
Not a requirement, but we should likely create another helper function in core/commands/cmdenv
and call it GetConfigRoot
. This way it makes it clear that the cast is the right thing to do. It would of saved me 10-15 minutes of review time.
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.
Due to an Oddity with how parsing arguments from Stdin when ever you have a command that can accept more than one argument from Stdin you must either call req.ParseBodyArgs()
before using req.Arguments
or iterate over them with req.BodyArgs()
, with the former being preferred for now. If you don't only the first argument will be read from Stdin.
You can test this my trying to pass two arguments via the command line to an affected command and then try again via Stdin.
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
25cb875
to
6ee5b09
Compare
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
6ee5b09
to
bc4a9ef
Compare
@kevina I had fixed them, could u help me review it again? |
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.
LGTM.
Refer: #5664
License: MIT
Signed-off-by: Overbool overbool.xu@gmail.com