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:
reynold
2025-08-28 21:08:58 +08:00
parent 159ede3794
commit ca98742891
4 changed files with 125 additions and 2 deletions

View File

@@ -508,6 +508,16 @@ sf-deploy -to DEMO-ORG \
- **Flexible Input**: Supports absolute and repository-relative paths
- **Command Echo**: Shows the actual `sf` command being executed for transparency
- **Focused Workflows**: Deploy, validate, retrieve, test, run Apex, manage orgs, data import/export, and tail logs
- **macOS Compatibility**: Full compatibility with macOS using portable timeout implementation
## macOS Compatibility
The wrapper scripts include a `utils.sh` helper that provides cross-platform timeout functionality. This ensures that scripts requiring timed execution (like `sf-logs-tail`) work correctly on macOS without requiring GNU coreutils.
The timeout helper automatically detects and uses:
1. `timeout` command (Linux/GNU systems)
2. `gtimeout` command (macOS with GNU coreutils)
3. Built-in fallback implementation (pure Bash for macOS)
## Tips