feat: add bds core, locale updates and safety fixes

This commit is contained in:
2026-05-31 14:01:34 +03:00
parent d1686355e8
commit c769140913
34 changed files with 1535 additions and 12 deletions

38
lib/logger.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
log() {
local level="$1"
shift
printf '[%s] [%s] %s\n' "$(date +'%Y-%m-%d %H:%M:%S')" "$level" "$*"
}
info() {
log "INFO" "$@"
}
warn() {
log "WARN" "$@"
}
error() {
log "ERROR" "$@"
}
debug() {
if [[ "${DEBUG:-no}" == "yes" ]]; then
log "DEBUG" "$@"
fi
}
fail() {
error "$@"
exit 1
}
run_cmd() {
if [[ "${DRY_RUN:-no}" == "yes" ]]; then
info "[dry-run] $*"
return 0
fi
"$@"
}