auto-detect non-interactive mode when no terminal is present
chezmoi run_onchange scripts don't receive CLI arguments, so the --non-interactive flag only works when running the script directly. Now also checks if stdin/stdout are real terminals to auto-detect non-interactive contexts like Vagrant provisioning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3e53d99ad2
commit
a7f938591b
@ -63,6 +63,11 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
# Auto-detect non-interactive mode when no real terminal is present
|
||||
if [ ! -t 0 ] || [ ! -t 1 ]; then
|
||||
NON_INTERACTIVE=1
|
||||
fi
|
||||
|
||||
# Timeout portability (macOS has gtimeout via coreutils, not timeout)
|
||||
TIMEOUT_BIN="$(command -v timeout || command -v gtimeout || true)"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user