Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
809 B
Bash
31 lines
809 B
Bash
#!/usr/bin/env bash
|
|
# Example --dry-run pattern for deployment/change scripts
|
|
# Recommendation: docs/10-best-practices/RECOMMENDATIONS_AND_SUGGESTIONS.md (§ Script Improvements)
|
|
# Usage: DRY_RUN=1 ./your-script.sh OR ./your-script.sh --dry-run
|
|
|
|
set -euo pipefail
|
|
|
|
DRY_RUN="${DRY_RUN:-0}"
|
|
for arg in "$@"; do
|
|
if [[ "$arg" == "--dry-run" || "$arg" == "-n" ]]; then
|
|
DRY_RUN=1
|
|
break
|
|
fi
|
|
done
|
|
|
|
run_or_echo() {
|
|
if [[ "$DRY_RUN" == "1" ]]; then
|
|
echo "[DRY-RUN] Would execute: $*"
|
|
else
|
|
"$@"
|
|
fi
|
|
}
|
|
|
|
# Example: run_or_echo pct set 106 --memory 8192
|
|
# Example: run_or_echo cp config.toml /opt/besu/
|
|
|
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
echo "DRY_RUN=$DRY_RUN - Use DRY_RUN=1 or --dry-run to preview without executing."
|
|
run_or_echo echo "Example command (no-op when dry-run)"
|
|
fi
|