printf_color() functions by assigning the first positional parameter and
shifting it out of the list of parameters. If the interface is misused
and the first positional parameter is also the only parameter, what
would happen? It is probably better to change both to handle that
situation the same way since the code savings is minimal.
While here, add back in a newline that was accidentally nuked in the
first commit.
echo flags aren't defined by POSIX. In general, anything more advanced
than a simple string followed by a newline should be handled by
printf(1) if portability/consistency are concerns.
Added new functions to handle this so that colors are kept separate from
the strings themselves (should make the script more maintainable in the
long run).
An additional benefit of using functions here is that errors and
warnings are more likely to be sent to STDERR.
* updater.sh/prefsCleaner.sh: Check for root and abort
Check if running as root and if any files have the owner/group as root|wheel.
Abort on both.
Should (hopefully) prevent stuff like: https://github.com/arkenfox/user.js/issues/1587
Discussion: https://github.com/arkenfox/user.js/pull/1595
---------
Co-authored-by: Mohammed Anas <triallax@tutanota.com>
Co-authored-by: earthlng <earthlng@users.noreply.github.com>
* prefsCleaner.bat: add -unattended flag
Usage:
prefsCleaner.bat -unattended
Skips the prompt for user input and proceeds when -unattended is specified. If omitted, default behaviour is unchanged.
---------
Signed-off-by: Keith Harrison <keithh@protonmail.com>
Co-authored-by: earthlng <earthlng@users.noreply.github.com>
.supported also hides/shows the UI. There is no need for this, it is overkill (and users might never be able to work out how to get them back). The .enabled prefs are enough to toggle the checkboxes IF they show based on .supportedCountries (which relies on browser.search.region)