Compare commits

...

2 Commits

Author SHA1 Message Date
Johannes Kimmel 6860eee843 buildscript: add color to the root warning
Use color output when the `tput` command is available.
`tput` handles terminal-dependant capabilities, so the script should
remain portable.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
2024-01-22 02:50:48 +01:00
Johannes Kimmel b3c05f60ea buildscript: print warning instead of failing build
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
2024-01-22 02:50:30 +01:00
1 changed files with 6 additions and 2 deletions

View File

@ -381,8 +381,12 @@ buildall() {
}
if [ "$(/usr/bin/id -u)" -eq 0 ]; then
echo "don't run buildscript as root"
exit 1
TPUT=$(command -v tput || echo ":")
textWarn="$($TPUT bold setaf 1)" # bold + red
textReset="$($TPUT sgr0)" # be a good citizen
printf "${textWarn}WARNING: buildscript is running as root${textReset}\n"
printf "${textWarn}WARNING: build may fail at a later stage${textReset}\n"
fi
if [ "$1" != "selectbsp" -a "$1" != "selectvariant" ]; then