-
Notifications
You must be signed in to change notification settings - Fork 483
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
Accept config directory from ENV variable #75
Conversation
Signed-off-by: Trevor Conn <trevor_conn@dell.com>
Signed-off-by: Trevor Conn <trevor_conn@dell.com>
pkg/config/config.go
Outdated
contents, err := ioutil.ReadFile(path) | ||
path := determinePath() | ||
fileName := determineConfigFile(profile) | ||
contents, err := ioutil.ReadFile(path + fileName) |
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 it would be more self-documenting if we were not to force path
ending with /
, but rather have here something like: path + "/" + filename
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.
Good, this is something I wanted to get feedback on. I don't have a strong preference.
pkg/config/config.go
Outdated
path = configDirectory | ||
} | ||
|
||
if path[len(path)-1:] != "/" { |
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.
Maybe no need to enforce finishing with /
. As explained before.
Signed-off-by: Trevor Conn <trevor_conn@dell.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
PR for this issue: #26