mirror of
https://github.com/acedanger/shell.git
synced 2026-03-27 05:16:07 -07:00
fix(backup-env-files): remove duplicate SCRIPT_DIR, add trap - ERR in cleanup to prevent re-entry
This commit is contained in:
@@ -26,7 +26,6 @@ BLUE='\033[0;34m'
|
|||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
||||||
DOCKER_DIR="$HOME/docker"
|
DOCKER_DIR="$HOME/docker"
|
||||||
BACKUP_REPO_NAME="docker-env-backup"
|
BACKUP_REPO_NAME="docker-env-backup"
|
||||||
BACKUP_DIR="$HOME/.env-backup"
|
BACKUP_DIR="$HOME/.env-backup"
|
||||||
@@ -241,6 +240,7 @@ EOF
|
|||||||
|
|
||||||
# Cleanup function for metrics finalization
|
# Cleanup function for metrics finalization
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
trap - ERR
|
||||||
if [[ "$METRICS_ENABLED" == "true" ]]; then
|
if [[ "$METRICS_ENABLED" == "true" ]]; then
|
||||||
if [[ -n "$1" && "$1" == "error" ]]; then
|
if [[ -n "$1" && "$1" == "error" ]]; then
|
||||||
metrics_backup_complete "failed" "Backup failed during execution"
|
metrics_backup_complete "failed" "Backup failed during execution"
|
||||||
|
|||||||
Reference in New Issue
Block a user