minor log style change

This commit is contained in:
Timerix 2025-11-09 23:26:43 +05:00
parent 6bfc0f5e9a
commit baf45a4b10
3 changed files with 24 additions and 24 deletions

View File

@ -5,18 +5,18 @@ include "@cbuild/include/functions.sh"
include "@cbuild/include/detect_os.sh"
function load_config {
local project_config_path="$1"
local proj_conf_file="$1"
TASK="$2"
#bool
#true or false
local quiet=$3
myprint "${BLUE}loading ${WHITE}'$project_config_path'"
myprint "${BLUE}loading ${WHITE}'$proj_conf_file'"
if [ -z "$project_config_path" ]; then
if [ -z "$proj_conf_file" ]; then
error "config path is null"
fi
if [ ! -f "$project_config_path" ]; then
error "${YELLOW}$project_config_path doesn't exist"
if [ ! -f "$proj_conf_file" ]; then
error "${YELLOW}$proj_conf_file doesn't exist"
fi
OS=$(detect_os)
@ -32,9 +32,9 @@ function load_config {
[ -z "$TASK" ] && TASK="no_task"
# getting cbuild version from config (CBUILD_VERSION declaration is at line 2)
exec_script_line "$project_config_path" 2 $quiet
exec_script_line "$proj_conf_file" 2 $quiet
myprint_quiet $quiet "${WHITE}${project_config_path} cbuild version: ${CYAN}$CBUILD_VERSION"
myprint_quiet $quiet "${WHITE}'${proj_conf_file}' cbuild version: ${CYAN}$CBUILD_VERSION"
myprint_quiet $quiet "${WHITE}installed cbuild version: ${CYAN}$INSTALLED_CBUILD_VERSION"
# checking versions
@ -50,13 +50,13 @@ function load_config {
# throw error on undefined variable usage
set -u
include "$project_config_path"
include "$proj_conf_file"
# load project user config
local project_user_config_path="$project_config_path.user"
file_copy_default_if_not_present "$project_user_config_path" "$project_user_config_path.default"
myprint "${BLUE}loading ${WHITE}'$project_user_config_path'"
include "$project_user_config_path"
local proj_conf_user_file="$proj_conf_file.user"
file_copy_default_if_not_present "$proj_conf_user_file" "$proj_conf_user_file.default"
myprint "${BLUE}loading ${WHITE}'$proj_conf_user_file'"
include "$proj_conf_user_file"
mkdir -p "$OUTDIR"
mkdir -p "$OBJDIR/objects"

View File

@ -5,7 +5,7 @@ include "@cbuild/include/myprint.sh"
function exec_script_line {
local script="$1"
local line_num="$2"
#bool
#true or false
local quiet=$3
myprint_quiet $quiet "${BLUE}reading line $line_num from $script"
@ -31,14 +31,14 @@ function replace_var_value_in_script(){
function clean_dir {
local dir="$1"
myprint "${WHITE}cleaning $dir"
myprint "${BLUE}cleaning ${WHITE}'$dir'"
rm -rf "$dir"
mkdir "$dir"
}
function delete_dir {
local dir="$1"
myprint "${WHITE}deleting $dir"
myprint "${BLUE}deleting ${WHITE}'$dir'"
rm -rf "$dir"
}
@ -46,7 +46,7 @@ function try_delete_dir_or_file {
local path="$1"
if [ -f "$path" ] || [ -d "$path" ]; then
rm -rf "$path"
myprint "${WHITE}deleting $path"
myprint "${BLUE}deleting ${WHITE}'$path'"
fi
}
@ -54,7 +54,7 @@ file_copy_default_if_not_present(){
local file="$1"
local file_default="$2"
if [ ! -f "$file" ]; then
myprint "${YELLOW}creating default ${WHITE}$file"
myprint "${YELLOW}creating default ${WHITE}'$file'"
cp -r "$file_default" "$file"
fi
}
@ -68,18 +68,18 @@ function exec_command {
}
function load_dependency_config {
local dependency_config_file="$1"
myprint "${BLUE}loading dependency config ${WHITE}${dependency_config_file}${BLUE}"
include "$dependency_config_file"
local dep_conf_file="$1"
myprint "${BLUE}loading dependency config ${WHITE}'${dep_conf_file}'"
include "$dep_conf_file"
}
# builds a dependency when $dep_out_files dont exist or rebuild task is executed
function build_dependency {
# path to *.config file
local dependency_config_file="$1"
local dep_conf_file="$1"
# true or false
local force_build="$2"
load_dependency_config "$dependency_config_file"
load_dependency_config "$dep_conf_file"
local proj_root_dir="$(pwd)"
myprint "${BLUE}entering dependency directory '${DEP_WORKING_DIR}'"

View File

@ -22,7 +22,7 @@ function myprint {
}
function myprint_quiet {
#bool
#true or false
local quiet=$1
local text="$2"
if [ "$quiet" != true ]; then