From: Bastian Dehn Date: Fri, 25 Sep 2026 14:48:20 +0000 (+0200) Subject: add flac check work path X-Git-Tag: v1.0.0^2~7^2~9 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=120fa2da55f3ab5d58c2ff4b320329e9fe5d982e;p=albentohandy.git add flac check work path --- diff --git a/src/lib/flac.sh b/src/lib/flac.sh index c0fdd80..308f358 100644 --- a/src/lib/flac.sh +++ b/src/lib/flac.sh @@ -16,4 +16,13 @@ flac_check_programs() || return $? } +flac_encode() +{ + local work_path="$1" + + [ -n "$work_path" ] \ + || flac_errlog "missing work path" \ + || return $? +} + flac_check_programs || return $? \ No newline at end of file diff --git a/tests/flac.bats b/tests/flac.bats index a86e0bc..d5a03b6 100755 --- a/tests/flac.bats +++ b/tests/flac.bats @@ -6,7 +6,7 @@ setup() { source "src/lib/flac.sh" } -# bats test_tag=flac:check_programs +# bats test_tags=flac:check_programs @test "failed: check programs missing metaflac" { command() { [ "$2" != "metaflac" ] || return 1 @@ -16,4 +16,12 @@ setup() { assert_failure assert_line --index 0 "❌ ERROR: command metaflac not found" +} + +# bats test_tags=flac:params +@test "failed: mising work path" { + run flac_encode + + assert_failure + assert_line --index 0 "❌ ERROR: missing work path" } \ No newline at end of file