Fix macOS compatibility: Add portable timeout helper
- Add utils.sh with cross-platform timeout functions for macOS compatibility - Fix sf-logs-tail to use portable_timeout instead of GNU timeout command - Fix test-all-wrappers.sh to use portable_timeout_seconds for testing - Update README.md with macOS compatibility documentation The timeout command is not available by default on macOS, causing sf-logs-tail and test scripts to fail. The new utils.sh provides fallback timeout functionality that works on Linux, macOS with/without GNU coreutils, maintaining exit code 124 compatibility.
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
# Debug logs tail wrapper for Salesforce CLI
|
||||
# Provides real-time debug log monitoring with filtering and formatting
|
||||
|
||||
# Source utilities for cross-platform compatibility
|
||||
source "$(dirname "$0")/utils.sh"
|
||||
|
||||
# Color codes for output formatting
|
||||
readonly RED='\033[0;31m'
|
||||
readonly GREEN='\033[0;32m'
|
||||
@@ -291,7 +294,7 @@ if [[ "$VERBOSE" == true ]]; then
|
||||
fi
|
||||
|
||||
# Start the log tailing with timeout
|
||||
timeout "${DURATION}m" sf "${SF_ARGS[@]}" 2>/dev/null | while IFS= read -r line; do
|
||||
portable_timeout "$DURATION" sf "${SF_ARGS[@]}" 2>/dev/null | while IFS= read -r line; do
|
||||
if should_show_log_entry "$line" "$FILTER_PATTERN" "$APEX_ONLY"; then
|
||||
format_log_entry "$line" "$SHOW_COLORS" "$VERBOSE"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user