-
Notifications
You must be signed in to change notification settings - Fork 386
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
expand secret-file path #977
Conversation
Typically the shell will expand paths such as ~/foo; however when given as an argument to --secret-file secret=~/foo, the shell did not expand this path. This addresses this issue. Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
return homeDir, nil, err | ||
} | ||
// See if SUDO_USER exists. Use that user's home dir. | ||
sudoUserName, ok := os.LookupEnv("SUDO_USER") |
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 @dchw had a nice function for fetching the current user or sudo user in his PR. Might be worth merging them somehow.
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.
This code came from the cliutil.DetectHomeDir() function; If we can fold more code into using this function that sounds like a good plan.
) | ||
|
||
// GetUserHomeDirs returns a map of all users and their homedirs | ||
func GetUserHomeDirs() (map[string]string, error) { |
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 feel that this is too much logic for what is normally needed... but hey... I guess it's now already written.
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.
this code was moved here from our autocompletion.getUsers()
, no new code was written in this PR for this function.
Typically the shell will expand paths such as
~/foo
; however when givenas an argument to
--secret-file secret=~/foo
, the shell did not expandthis path. This addresses this issue.
Signed-off-by: Alex Couture-Beil alex@earthly.dev