I am creating a provisioning script that has to be ran with sudo, but when I do .pyenv ends up under the /root directory. How do I fix this? I don't see any documentation or recommendations online.
sudo provision.sh
sudo -E -u "$SUDO_USER" curl https://pyenv.run | bash
I'm guessing all I can do is run sudo -E -u provision.sh instead?