Skip to content

Commit f4ebda3

Browse files
committed
feat: add strict error handling with set -euo pipefail
- Add 'set -euo pipefail' at the top of the script for robust error handling - Define safe IFS variable to prevent word splitting issues - Ensures script exits on any command failure (-e) - Treats unset variables as errors (-u) - Handles pipe failures properly (-o pipefail) - Improves script robustness and prevents silent failures This follows bash best practices for production scripts and makes debugging easier by failing fast on any unexpected conditions.
1 parent b39c39f commit f4ebda3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

configuration/scripts/klipper-fork-migration.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
25
if [ "$EUID" -ne 0 ]; then
36
echo "ERROR: Please run as root"
47
exit 1

0 commit comments

Comments
 (0)