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

24
lib/utils.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# utils.sh - Utility functions for the project
# Function to check if a required command is available
need() {
command -v "$1" >/dev/null || { echo "$1 is required but not installed"; exit 1; }
}
# Function to log messages with levels
log() {
local level="$1"
local message="$2"
echo "[$level] $message"
}
# Function to validate input arguments
validate_arg() {
local arg_name="$1"
local arg_value="$2"
if [[ -z "$arg_value" ]]; then
log "ERROR" "Missing required argument: $arg_name"
exit 1
fi
}