From: Bastian Dehn Date: Sun, 9 Aug 2026 10:32:29 +0000 (+0200) Subject: add command check savelog X-Git-Tag: v1.0.6^2~1^2~15 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=7ea010f2d74dd6e04c420fa013d72b56ca027a44;p=simple-backup.git add command check savelog --- diff --git a/src/backup b/src/backup index 24daa6f..b4ce4e6 100755 --- a/src/backup +++ b/src/backup @@ -68,6 +68,9 @@ exists_needed_commands() command -v ssh > /dev/null \ || errlog "command ssh not found" \ || return $? + command -v savelog > /dev/null \ + || errlog "command savelog not found" \ + || return $? } exists_config_file() diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats index 71ad297..3c3ccfc 100755 --- a/tests/backup_tests.bats +++ b/tests/backup_tests.bats @@ -91,6 +91,19 @@ teardown() { assert_line --index 1 "❌ ERROR: command ssh not found" } +# bats test_tags=backup:start,backup:savelog +@test "failure savelog command not found" { + command() { + [ "$2" != "savelog" ] || return 1 + } + + run main + + assert_failure + assert_line --index 0 "⭐ START: backup" + assert_line --index 1 "❌ ERROR: command savelog not found" +} + # bats test_tags=backup:start,backup:config @test "failure config.yaml not found" { exists_config_file() {