Skip to content

feat: add CommandWrap::spawn_with#33

Merged
passcod merged 1 commit intowatchexec:mainfrom
domenkozar:feat/spawn-with
Mar 8, 2026
Merged

feat: add CommandWrap::spawn_with#33
passcod merged 1 commit intowatchexec:mainfrom
domenkozar:feat/spawn-with

Conversation

@domenkozar
Copy link
Contributor

Summary

  • Adds CommandWrap::spawn_with(spawner) method that accepts a custom FnOnce(&mut Command) -> io::Result<Child> closure for spawning
  • Preserves the full wrapper lifecycle (pre_spawn → spawner → post_spawn → wrap_child)
  • Refactors spawn() to delegate to spawn_with(|cmd| cmd.spawn())

Test plan

  • cargo check --features std,tokio1 passes
  • Existing test suite passes (no regressions)

🤖 Generated with Claude Code

Allows callers to provide their own spawning closure instead of the
default `command.spawn()`, useful for platform-specific or custom
spawning mechanisms while preserving the full wrapper lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@passcod passcod merged commit 9632e9d into watchexec:main Mar 8, 2026
13 checks passed
@passcod
Copy link
Member

passcod commented Mar 8, 2026

Released as 9.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants