Skip to content

Conversation

@gardner
Copy link

@gardner gardner commented Apr 15, 2016

Adding -i to sudo command. This uses a login shell for the $user.

Adding `-i` to sudo command. This uses a login shell for the $user.
@wizpig64
Copy link

This creates a situation where the current directory is reset to the user's home directory, effectively ignoring the dir variable.

@gardner
Copy link
Author

gardner commented May 1, 2016

That is a problem. The reason why I submitted this is because I am running a node app via nvm which is loaded via the login scripts. I wonder if setting the user HOME directory to the dir value would be appropriate?

sudo -H "$dir"

If it's not solving any problems then feel free to just close this PR.

Thanks for the template!

@wizpig64
Copy link

wizpig64 commented May 1, 2016

well its not my template, but thanks! I suppose that would work for my case, but I could imagine a script that depends on $HOME being accurate breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants