]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add flac check work path
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 14:48:20 +0000 (16:48 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 14:48:20 +0000 (16:48 +0200)
src/lib/flac.sh
tests/flac.bats

index c0fdd805783277bca2531737a4520dd7cd537dbf..308f35845aaf2ecfb6875e2579bc91af74742bce 100644 (file)
@@ -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
index a86e0bca5d7f24bea79b5d71efce44afc90d6b53..d5a03b6b9f9ba97411b123ba25fb47d59a6b9720 100755 (executable)
@@ -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