
The Bash Increment That Killed My Script
My test script died silently after the first passing test. The culprit: ((var++)) combined with set -e.

My test script died silently after the first passing test. The culprit: ((var++)) combined with set -e.

Create a macOS user with sysadminctl. Assume home directory exists. It doesn’t. Unlike Linux useradd -m, macOS requires you to create it yourself.

A common frontend gotcha: Lenis smooth scroll library and CSS scroll-snap are incompatible. Here’s why they fight and how to choose between them.
Lenis smooth scroll library is INCOMPATIBLE with CSS scroll-snap. They fight for scroll control.
Wedding invitation site had both Lenis (for smooth parallax scrolling) and CSS scroll-snap (for section-by-section navigation). Neither worked properly.
Librarian agent research: “CRITICAL: Lenis and CSS scroll-snap are INCOMPATIBLE - Lenis hijacks native scrolling” Solution: “Remove Lenis, use CSS scroll-snap + native smooth scroll for better mobile performance”
Lenis works by:
requestAnimationFrameCSS scroll-snap expects:
When combined:
Removed Lenis entirely:
// Before (Layout.astro)
import Lenis from 'lenis';
const lenis = new Lenis({ ... });
lenis.on('scroll', ScrollTrigger.update);
// After
// Just GSAP ScrollTrigger, no Lenis
gsap.registerPlugin(ScrollTrigger);
Added native smooth scroll:
Read moreTest script failed silently after first passing test. The script used set -e (exit on error) combined with bash arithmetic increment:
set -e
TESTS_PASSED=0
log_success() {
echo "[PASS] $1"
((TESTS_PASSED++)) # THIS CAUSES EXIT!
}
((TESTS_PASSED++)) returns exit code based on the POST-increment value:
TESTS_PASSED=0: ((0++)) evaluates to 0 (falsy) → exit code 1set -e sees exit code 1 → script exitsThis is a common bash gotcha that’s hard to debug because:
Use explicit arithmetic assignment instead:
log_success() {
echo "[PASS] $1"
TESTS_PASSED=$((TESTS_PASSED + 1)) # Safe - always returns 0
}
Never use ((var++)) with set -e. The increment operator’s return value is the pre-increment value, which is falsy when starting from 0.