From: Christian Heller Date: Fri, 4 Apr 2025 22:05:23 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%22https:/validator.w3.org/%7Broute%7D?a=commitdiff_plain;h=0a930425f53d95b2b579088246aab3f2b2738dd4;p=config Fix. --- diff --git a/bookworm/scripts/lib/copy_dirtree b/bookworm/scripts/lib/copy_dirtree index 438f4bd..13c1c85 100644 --- a/bookworm/scripts/lib/copy_dirtree +++ b/bookworm/scripts/lib/copy_dirtree @@ -1,5 +1,7 @@ +. lib/expect_n_args + copy_dirtree() { - expect_min_n_args 3 '(source root, target root, tags)' "$@" + expect_n_args 3 99 'SOURCE_ROOT TARGET_ROOT TAG...' $@ SOURCE_ROOT="$1" TARGET_ROOT="$2" shift 2 diff --git a/bookworm/scripts/lib/expect_min_n_args b/bookworm/scripts/lib/expect_min_n_args deleted file mode 100644 index 8f9c74d..0000000 --- a/bookworm/scripts/lib/expect_min_n_args +++ /dev/null @@ -1,9 +0,0 @@ -expect_min_n_args() { - MIN_ARGS="$1" - EXPLAINER="$2" - shift 2 - if [ "$#" -lt "${MIN_ARGS}" ]; then - echo "Need at least ${MIN_ARGS} arguments … ${EXPLAINER}" - false - fi -} diff --git a/testing/scripts/lib/expect_min_n_args b/testing/scripts/lib/expect_min_n_args deleted file mode 120000 index 0d272bc..0000000 --- a/testing/scripts/lib/expect_min_n_args +++ /dev/null @@ -1 +0,0 @@ -../../../bookworm/scripts/lib/expect_min_n_args \ No newline at end of file diff --git a/testing/scripts/lib/expect_min_n_args b/testing/scripts/lib/expect_min_n_args new file mode 100644 index 0000000..8f9c74d --- /dev/null +++ b/testing/scripts/lib/expect_min_n_args @@ -0,0 +1,9 @@ +expect_min_n_args() { + MIN_ARGS="$1" + EXPLAINER="$2" + shift 2 + if [ "$#" -lt "${MIN_ARGS}" ]; then + echo "Need at least ${MIN_ARGS} arguments … ${EXPLAINER}" + false + fi +}