feat: modularize scripts and improve project architecture
All checks were successful
Auto Changelog & Release / release (push) Successful in 8s

- Added `lib/utils.sh` and `lib/logging.sh` for reusable utility and logging functions.
- Updated `run.sh` and `scripts/generate-changelog.sh` to use the new utility and logging functions (`validate_arg`, `log_info`, `log_error`).
- Add `config.env` for better clarity and updated all references in the project.
- Enhanced documentation in `README.md` to reflect the new configuration file and usage instructions.
- Improved error handling and logging consistency across scripts.
This commit is contained in:
2025-07-02 12:59:16 +02:00
parent a59359545d
commit ba7b9f2928
5 changed files with 116 additions and 31 deletions

29
lib/logging.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# logging.sh - Logging functions for the project
# Log levels
LOG_LEVEL_INFO="INFO"
LOG_LEVEL_WARN="WARN"
LOG_LEVEL_ERROR="ERROR"
# Function to log a message with a specific level
log_message() {
local level="$1"
local message="$2"
local timestamp
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo "[$timestamp] [$level] $message"
}
# Convenience functions for specific log levels
log_info() {
log_message "$LOG_LEVEL_INFO" "$1"
}
log_warn() {
log_message "$LOG_LEVEL_WARN" "$1"
}
log_error() {
log_message "$LOG_LEVEL_ERROR" "$1"
}