mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
color tweaks
This commit is contained in:
parent
82ab545f1a
commit
921f34d42e
1 changed files with 4 additions and 3 deletions
|
@ -10,6 +10,7 @@ set -e -o errexit -o nounset -o pipefail
|
|||
declare -g error_message_color="\033[1;31m"
|
||||
declare -g warn_message_color="\033[1;34m"
|
||||
declare -g notice_message_color="\033[1;34m"
|
||||
declare -g success_message_color="\033[1;32m"
|
||||
declare -g color_clear="\033[1;0m"
|
||||
|
||||
# Current and previous log prefix
|
||||
|
@ -80,7 +81,7 @@ function run-command-as() {
|
|||
target_user=${1}
|
||||
shift
|
||||
|
||||
log-info-stderr "👷 Running [${*}] as [${target_user}]"
|
||||
log-info-stderr "${notice_message_color}👷 Running [${*}] as [${target_user}]${color_clear}"
|
||||
|
||||
if [[ ${target_user} != "root" ]]; then
|
||||
stream-prefix-command-output su --preserve-environment "${target_user}" --shell /bin/bash --command "${*}"
|
||||
|
@ -91,11 +92,11 @@ function run-command-as() {
|
|||
exit_code=$?
|
||||
|
||||
if [[ $exit_code != 0 ]]; then
|
||||
log-error "❌ Error!"
|
||||
log-error "${error_message_color}❌ Error!${color_clear}"
|
||||
return "$exit_code"
|
||||
fi
|
||||
|
||||
log-info-stderr "✅ OK!"
|
||||
log-info-stderr "${success_message_color}✅ OK!${color_clear}"
|
||||
return "$exit_code"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue