Summary
When running check-performance.sh from a non-interactive context (e.g., AI assistant, CI/CD, subprocess), the scanner fails with multiple /dev/tty: Device not configured errors and does not generate HTML reports or log files.
Steps to Reproduce
- Run the scanner from a non-interactive shell (no TTY attached):
./dist/bin/check-performance.sh --paths /path/to/theme --format json
- Observe errors at the end of execution:
/Users/.../check-performance.sh: line 5537: /dev/tty: Device not configured
/Users/.../check-performance.sh: line 5541: /dev/tty: Device not configured
/Users/.../check-performance.sh: line 5605: /dev/tty: Device not configured
/Users/.../check-performance.sh: line 5606: /dev/tty: Device not configured
Expected Behavior
Scanner should detect non-interactive mode and either:
- Skip interactive prompts entirely
- Use sensible defaults when TTY is unavailable
- Provide a
--non-interactive or --batch flag
Actual Behavior
- JSON output is printed to stdout (works)
- HTML report is NOT generated
- Log file may not be written
- Exit code is 1 (unclear if from findings or TTY errors)
Environment
- macOS Darwin 24.6.0
- Scanner version: 1.2.4
- Context: Running from Claude Code (AI assistant without TTY)
Suggested Fix
Check for TTY availability before prompting:
if [ -t 0 ]; then
# Interactive prompts OK
else
# Use defaults or skip
fi
Impact
Blocks AI-assisted workflows and CI/CD integration when HTML reports are needed.
Summary
When running
check-performance.shfrom a non-interactive context (e.g., AI assistant, CI/CD, subprocess), the scanner fails with multiple/dev/tty: Device not configurederrors and does not generate HTML reports or log files.Steps to Reproduce
Expected Behavior
Scanner should detect non-interactive mode and either:
--non-interactiveor--batchflagActual Behavior
Environment
Suggested Fix
Check for TTY availability before prompting:
Impact
Blocks AI-assisted workflows and CI/CD integration when HTML reports are needed.