-
Notifications
You must be signed in to change notification settings - Fork 312
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
Support tiup env command #788
Conversation
Fix pingcap#632 Signed-off-by: lucklove <gnu.crazier@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #788 +/- ##
==========================================
- Coverage 52.35% 42.46% -9.89%
==========================================
Files 261 259 -2
Lines 18820 18710 -110
==========================================
- Hits 9853 7945 -1908
- Misses 7432 9446 +2014
+ Partials 1535 1319 -216
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
) | ||
|
||
var envList = []string{ | ||
localdata.EnvNameHome, |
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.
Prefer to add a comment in the localdata
package and link here.
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.
Rest LGTM
cmd/env.go
Outdated
|
||
func showEnvList(names ...string) { | ||
for _, name := range names { | ||
fmt.Printf("%s=\"%s\"\n", name, os.Getenv(name)) |
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.
Prefer to show only value if the user specifies environment variables explicitly.
➜ devel go env GOPATH
/c/devel/gopath
➜ devel go env GOPATH GOROOT
/c/devel/gopath
/usr/local/go
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.
Yes, I have noticed the golang's behavior, but I don't know what's the benefit of this. Can you explain this?
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 think to output the value of an envvar instead of key=value
may help get the value in the script, and the script doesn't need to split the string.
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.
OK
Signed-off-by: lucklove <gnu.crazier@gmail.com>
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
/merge |
/run-all-tests |
Fix #632
Signed-off-by: lucklove gnu.crazier@gmail.com
What problem does this PR solve?
Fix #632
What is changed and how it works?
Add the env subcommand
Check List
Tests
Related changes
Release notes: