./flow3 core:setfilepermissions should not rely on sudo without proper test
./flow3 core:setfilepermissions calls sudo without a proper test if it is installed and correctly setup.
On systems without sudo this leads to gazillions of ugly failing sudo calls within the find loop.
This can be reproduced on standard debian installation which is shipped without sudo.
I suggest not to rely on sudo at all, but prompt the user for running
./flow3 core:setfilepermissions as root or with sudo himself.
Updated by Steffen Müller almost 10 years ago
Ubuntu ships sudo when using default installer. Debian (aka ubuntu vanilla) does not. Those .deb based systems which have been setup with dbootstrap do not neccessarily have sudo. And Ubuntu users could have uninstalled sudo.
However, the main point is: shell scripts should always test for third party tools (maybe with one exception for gnutools).
But in case of sudo, I would never use sudo wraps in shell scripts:
"The thing is that the best decision is always the one that gives control to the user, so that he decides to run your script as root or not by making him write "sudo" or not..."
So please just remove sudo calls from the script. Instead, add a check if the user has root permissions and exit with a notice if not.