fix(backup-env-files): remove duplicate SCRIPT_DIR, add trap - ERR in cleanup to prevent re-entry

This commit is contained in:
Peter Wood
2026-03-25 21:25:20 -04:00
parent 74a2453edc
commit bd1d142800

View File

@@ -26,7 +26,6 @@ BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCKER_DIR="$HOME/docker"
BACKUP_REPO_NAME="docker-env-backup"
BACKUP_DIR="$HOME/.env-backup"
@@ -241,6 +240,7 @@ EOF
# Cleanup function for metrics finalization
cleanup() {
trap - ERR
if [[ "$METRICS_ENABLED" == "true" ]]; then
if [[ -n "$1" && "$1" == "error" ]]; then
metrics_backup_complete "failed" "Backup failed during execution"