log avoids tput if unneeded
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
b54ed5f8a8
commit
6a5bc73e67
24
bin/log
24
bin/log
|
@ -1,10 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
YELLOW="$(tput setaf 12)"
|
||||
GREEN="$(tput setaf 10)"
|
||||
RED="$(tput setaf 9)"
|
||||
RESET="$(tput sgr0)"
|
||||
|
||||
die () {
|
||||
msg="$1"
|
||||
code="$2"
|
||||
|
@ -44,10 +39,7 @@ parse_input () {
|
|||
arg_log=0
|
||||
;;
|
||||
c)
|
||||
YELLOW=""
|
||||
GREEN=""
|
||||
RED=""
|
||||
RESET=""
|
||||
flag_nocolor=1
|
||||
;;
|
||||
s)
|
||||
arg_ship="$OPTARG"
|
||||
|
@ -58,6 +50,7 @@ parse_input () {
|
|||
f)
|
||||
arg_log=0
|
||||
flag_file=1
|
||||
flag_nocolor=1
|
||||
arg_file="$OPTARG"
|
||||
;;
|
||||
t)
|
||||
|
@ -196,6 +189,7 @@ main() {
|
|||
flag_shortlist=0
|
||||
flag_file=0
|
||||
flag_title=0
|
||||
flag_nocolor=0
|
||||
|
||||
arg_options="hvdct:f:s:z"
|
||||
arg_log=1
|
||||
|
@ -205,6 +199,18 @@ main() {
|
|||
|
||||
parse_input "$@"
|
||||
|
||||
if [ $flag_nocolor -gt 0 ]; then
|
||||
YELLOW=""
|
||||
GREEN=""
|
||||
RED=""
|
||||
RESET=""
|
||||
else
|
||||
YELLOW="$(tput setaf 12)"
|
||||
GREEN="$(tput setaf 10)"
|
||||
RED="$(tput setaf 9)"
|
||||
RESET="$(tput sgr0)"
|
||||
fi
|
||||
|
||||
# debug
|
||||
if [ $flag_debug -gt 0 ]; then
|
||||
set -x
|
||||
|
|
11
bin/web
11
bin/web
|
@ -317,8 +317,17 @@ if [ "$run_user" = "root" ] || [ "$run_user" = "publish" ]; then
|
|||
rsync -r --delete "${temp_dir}/" "${html_dir}/"
|
||||
rm -rf "${temp_dir}"
|
||||
|
||||
# Generate RSS
|
||||
# shellcheck source=rss
|
||||
# shellcheck disable=SC1091
|
||||
. "${SCRIPTPATH}/rss"
|
||||
# Generate RSS
|
||||
# shellcheck source=atom
|
||||
# shellcheck disable=SC1091
|
||||
. "${SCRIPTPATH}/atom"
|
||||
|
||||
# Let user's know it's done
|
||||
printf "Web rebuilt.\\n"
|
||||
printf "Web and Feeds rebuilt.\\n"
|
||||
else
|
||||
exec sudo -u publish "$0" "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue