refactor(install): improve modular architecture and error handling
- Remove redundant installation checks in arduino.sh, git.sh - Add bash shell enforcement in install.sh to prevent compatibility issues - Streamline Arduino CLI installation logic for both Arch and other systems - Improve Git and Lazygit installation messaging consistency - Update install usage instructions for better clarity - Enhance shell compatibility by enforcing bash execution
This commit is contained in:
@@ -67,6 +67,17 @@ end_quiet_mode() {
|
||||
echo ""
|
||||
}
|
||||
|
||||
# ── Config backup helper ─────────────────────────────────────────
|
||||
BACKUP_DIR="$HOME/.config/archduino/backups/$(date +%Y%m%d_%H%M%S)"
|
||||
|
||||
backup_config() {
|
||||
local src="$1"
|
||||
[[ ! -e "$src" ]] && return 0
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
cp -a "$src" "$BACKUP_DIR/"
|
||||
info "Backed up $(basename "$src") → $BACKUP_DIR/"
|
||||
}
|
||||
|
||||
# ── Detect environment ──────────────────────────────────────────
|
||||
IS_WSL=false
|
||||
[[ -f /proc/version ]] && grep -qi microsoft /proc/version && IS_WSL=true
|
||||
|
||||
Reference in New Issue
Block a user