feat(core): add validated configuration and CLI foundation

This commit is contained in:
2026-10-11 23:34:01 +03:00
parent 216b09474e
commit 987c000320
8 changed files with 728 additions and 17 deletions
+12 -2
View File
@@ -2,8 +2,10 @@
set -Eeuo pipefail
umask 077
readonly HELPERS_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly PROJECT_DIR="$(cd -- "${HELPERS_DIR}/.." && pwd)"
HELPERS_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly HELPERS_DIR
PROJECT_DIR="$(cd -- "${HELPERS_DIR}/.." && pwd)"
readonly PROJECT_DIR
TEST_ROOT=''
TEST_MOCK_LOG=''
TEST_FAILURES=0
@@ -67,6 +69,14 @@ assert_file_exists() {
fi
}
assert_file_absent() {
local path=$1 message=${2:-файл отсутствует}
((TEST_ASSERTIONS += 1))
if [[ -e "$path" ]]; then
record_failure "${message}: найден [${path}]"
fi
}
assert_file_mode() {
local expected=$1 path=$2 actual message
actual=$(stat -c '%a' -- "$path")