printf "\n"
}
+path_backup()
+{
+ local config="$1"
+ local machine="$2"
+ local path="$3"
+ local full_backup_path="$4"
+
+ # TODO: config read - rsync implementation
+}
+
machine_backup_pathes()
{
local YELLOW="\e[0;33m"
local pathes=()
mapfile -t pathes < <(echo "$config" \
| jq --raw-output ".machines.$machine.pathes[]")
+ [ -n "$NOCOLOR" ] && YELLOW= && LIGHTPURPLE= && RESET=
local path=
for path in "${pathes[@]}"; do
print_line
printf "ℹ️ INFO: machine ${LIGHTPURPLE}%s${RESET}; " "$machine"
printf "path ${YELLOW}%s${RESET}\n\n" "$path"
+ path_backup "$config" \
+ "$machine" \
+ "$path" \
+ "$full_backup_path" \
+ || return $?
print_line
done
}
bats_load_library 'bats-support'
bats_load_library 'bats-assert'
export TESTMODE="ON"
+ export NOCOLOR="ON"
export CONFIG_FILE="src/config-example.yaml"
source src/backup
date() {
teardown() {
unset TESTMODE
+ unset NOCOLOR
unset CONFIG_FILE
rm --recursive --force "build/2000-01-01_01_backup"
}