Files
smom-dbis-138/scripts/automation/add-error-handling.sh
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

41 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Add error handling to scripts missing it
# Adds set -euo pipefail to scripts that don't have it
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
count=0
while IFS= read -r -d '' file; do
# Skip if already has error handling
if head -5 "$file" | grep -q "set -"; then
continue
fi
# Skip library files (they may intentionally not have error handling)
if [[ "$file" =~ /lib/ ]]; then
continue
fi
# Find line after shebang
line_num=2
if head -1 "$file" | grep -q "^#!"; then
# Check if line 2 is empty or a comment
if sed -n '2p' "$file" | grep -qE '^[[:space:]]*$|^[[:space:]]*#'; then
# Find first non-empty, non-comment line
line_num=$(awk '/^[^#[:space:]]/ {print NR; exit}' "$file")
fi
fi
# Insert error handling
sed -i "${line_num}i set -euo pipefail" "$file"
((count++)) || true
done < <(find scripts -name "*.sh" -type f -print0)
echo "✅ Added error handling to $count scripts"