added bash time function call

This commit is contained in:
timerix 2023-02-10 12:52:28 +06:00
parent 81358b72f8
commit 1b38b43c54
2 changed files with 21 additions and 15 deletions

View File

@ -1,21 +1,24 @@
#!/bin/bash
tabs 4
TASK=$1
printf "${CYAN}===========[$TASK]===========\n"
source cbuild/init.sh
function call_task {
TASK=$1
printf "${CYAN}===========[$TASK]===========\n"
source cbuild/init.sh
clear_dir $OBJDIR
clear_dir $OBJDIR
if [ -f "$PRE_TASK_SCRIPT" ]; then
if [ -f "$PRE_TASK_SCRIPT" ]; then
printf "${BLUE}executing $PRE_TASK_SCRIPT\n"
source "$PRE_TASK_SCRIPT"
fi
fi
source $TASK_SCRIPT
printf "${GRAY}"
source $TASK_SCRIPT
printf "${GRAY}"
if [ -f "$POST_TASK_SCRIPT" ]; then
if [ -f "$POST_TASK_SCRIPT" ]; then
printf "${BLUE}executing $POST_TASK_SCRIPT\n"
source "$POST_TASK_SCRIPT"
fi
fi
}
time call_task $1

View File

@ -1,7 +1,10 @@
#!/bin/bash
tabs 4
source cbuild/colors.sh
source cbuild/functions.sh
source cbuild/detect_os.sh
# exit on errors
set -eo pipefail