FIX: Improve startup flow error handling and correctness
CRITICAL: Library sourcing error handling - launcher.sh lines 21-25: Added error checks for all source commands - Each library now reports if it fails to load - Script exits with message instead of silent failure MEDIUM: init_directories error checking - launcher.sh lines 630-631: Added error handling for mkdir -p - Script now reports if directory creation fails - Better user feedback on initialization errors HIGH: Stderr redirect cleanup - run.sh line 14: Removed misplaced 2>/dev/null after closing bracket - launcher.sh lines 678, 694: Reordered redirects for clarity (read ... </dev/tty 2>/dev/null instead of 2>/dev/null </dev/tty) REASON: Improves startup robustness by catching initialization failures early and providing helpful error messages instead of silent failures.
This commit is contained in:
@@ -11,7 +11,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# Fix HISTFILE if set to non-existent path (prevents crashes on sourcing)
|
||||
if [ -n "$HISTFILE" ]; then
|
||||
HISTFILE_DIR="$(dirname "$HISTFILE" 2>/dev/null)"
|
||||
if [ ! -d "$HISTFILE_DIR" ] 2>/dev/null; then
|
||||
if [ ! -d "$HISTFILE_DIR" ]; then
|
||||
# Fallback to default history location
|
||||
export HISTFILE="$HOME/.bash_history"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user