refactor: improve script modularity and logging consistency
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
All checks were successful
Auto Changelog & Release / release (push) Successful in 6s
- Updated `scripts/generate-changelog.sh` to use `log_info` and `log_error` for all outputs. - Moved `source` statements for utility files to the top of the script. - Refactored `scripts/install-git-cliff.sh` to replace `echo` with logging functions. - Ensured consistent error handling and logging across all scripts.
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
# • Generates the changelog; removes a leading empty line.
|
||||
set -euo pipefail
|
||||
|
||||
source "$(dirname "$0")/../lib/utils.sh"
|
||||
source "$(dirname "$0")/../lib/logging.sh"
|
||||
|
||||
# ───────────────────────────────────────────────
|
||||
CONFIG_FILE=""
|
||||
TAG=""
|
||||
@@ -40,8 +43,8 @@ while [[ $# -gt 0 ]]; do
|
||||
done
|
||||
|
||||
# 2 Basic validation
|
||||
[[ -z "$CONFIG_FILE" || -z "$TAG" ]] && { echo "❌ --config and --tag are required"; show_help; exit 1; }
|
||||
[[ "$DEBUG" = false && -z "$OUT_FILE" ]] && { echo "❌ --out is required unless --debug is set"; show_help; exit 1; }
|
||||
[[ -z "$CONFIG_FILE" || -z "$TAG" ]] && { log_error "--config and --tag are required"; show_help; exit 1; }
|
||||
[[ "$DEBUG" = false && -z "$OUT_FILE" ]] && { log_error "--out is required unless --debug is set"; show_help; exit 1; }
|
||||
[[ ! -r "$CONFIG_FILE" ]] && { log_error "Config file not found or unreadable: $CONFIG_FILE"; exit 1; }
|
||||
if [[ "$DEBUG" = false ]]; then
|
||||
OUT_DIR=$(dirname "$OUT_FILE")
|
||||
|
Reference in New Issue
Block a user