-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
added becomeSetHome method to add -H flag when using sudo #1556
added becomeSetHome method to add -H flag when using sudo #1556
Conversation
Nice! But how does this implemented for example in ansible? |
And please update changelog. |
This feature add the -H flasg to the current implementation of the become() method: In this way the ~ directory will be the /home/user directory. This could be useful because not in all systems is the default behaviour as reported in the sudo man:
Ansible is doing this as a default behaviour. |
Maybe we can do it as default too and merge in into v7? |
I think it could be good as a default behaviour too. My current workaround, using version 6.x is to declare become as below:
|
src/Host/Host.php
Outdated
} | ||
|
||
/** | ||
* @param bool $becomeSetHome |
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.
would be great to have more docs on this "setter", so people know why/when this switch will be usefull.
Let's use -H by default and merge it then. |
I have added the becomeSetHome method to add the -H flag when become is used. In this way is possible to use home directory of the current user.