From: Bastian Dehn Date: Wed, 5 Aug 2026 15:27:47 +0000 (+0200) Subject: add no color and path backup method not implement X-Git-Tag: v1.0.6^2~1^2~52 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2f60ca285ca58aa249b7f5c3ae8a387613e84640;p=simple-backup.git add no color and path backup method not implement --- diff --git a/src/backup b/src/backup index 6ede52d..7ab21bc 100755 --- a/src/backup +++ b/src/backup @@ -128,6 +128,16 @@ print_line() 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" @@ -139,12 +149,18 @@ machine_backup_pathes() 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 } diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats index 0b614f3..eb1ec4f 100755 --- a/tests/backup_tests.bats +++ b/tests/backup_tests.bats @@ -4,6 +4,7 @@ setup() { 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() { @@ -13,6 +14,7 @@ setup() { teardown() { unset TESTMODE + unset NOCOLOR unset CONFIG_FILE rm --recursive --force "build/2000-01-01_01_backup" }