Skip to content

fix(hooks): post-test-runner.sh broken on macOS — date +%s%3N and missing timeout #33

Description

@ulises-c

Bug

post-test-runner.sh errors on macOS due to two GNU-isms:

  1. date +%s%3N%3N (millisecond suffix) is not supported by BSD date on macOS. It outputs a literal N in the timestamp, causing the arithmetic on line 44 to fail with value too great for base.
  2. timeout — ships as gtimeout on macOS (via GNU coreutils); the bare timeout command does not exist, so line 41 fails with timeout: command not found.

Fix

  • Replace date +%s%3N with python3 -c 'import time; print(int(time.time() * 1000))'
  • Replace timeout 60 with $(command -v gtimeout || command -v timeout || echo bash) 60 (or guard with command -v)

Impact

The hook fires on every Write/Edit tool call and exits with an error, even when the underlying file write succeeded. Noisy but not blocking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions