Make sudo conditional to user/env
ToroNZ opened this issue · comments
Noticed that this function was expanded quite a bit and "sudo" is now a dependency (which broke CI builds for me in Bitbucket). Perhaps we could make sudo optional if not running as root or in CI runners?... like:
#!/bin/bash
if [ ! "$CI" ]; then
if [ "$USER" != "root" ]; then
SUDO="sudo "
fi
fi
I've had a quick look and they seem to be related to #27 . Though I never had issues adding extra files in Ubuntu Focal (20.04). So there must be something more to it... I hope to dig a little bit deeper on the following days, for now I will lock this submodule to the previous commit.
BTW - Kudos @cloudymax for maintaining this tool :)
Lines 387 to 398 in d814df0
Thanks for the kind words as well as letting me know the changes cased issues with your flow, ill definitely need to do some testing to sort out a solution for user/group/root/sudo permissions.
I think part of the problem is that 20.04 is the last version before the switch to the new ISO creation process using El troito, but I was unable to get the previous extra files method to work on 22.04.
Could you share how your running the command for 20.04 so I can try to get in-sync with how you're using the tool?
Work has been very hectic this month so I apologize for the delayed reply 🙏