Running install.sh can show a misleading error message if the user has recently authenticated with sudo or does not have a password set.
Under normal use, the install script prints cp: cannot create regular file '/usr/local/bin/fossa': Permission denied and then prompts the user for their sudo password as expected:
However, if the user doesn't need to be prompted for their sudo password, this error message is still shown and it's not immediately clear if the installation succeeded (it did):
Running install.sh can show a misleading error message if the user has recently authenticated with
sudo
or does not have a password set.Under normal use, the install script prints
cp: cannot create regular file '/usr/local/bin/fossa': Permission denied
and then prompts the user for theirsudo
password as expected:However, if the user doesn't need to be prompted for their
sudo
password, this error message is still shown and it's not immediately clear if the installation succeeded (it did):fossa-cli's installer does not have this problem, as it silences the stderr output of non-
sudo
commands if they are immediately retried withsudo
on failure. It also usesinstall
instead ofcp
to copy the executable into the target directory which is a better tool for this job, but is not a POSIX program so we can't ensure it will be present.