Skip to content

File watching: Doesn't re-run the task if the process never exits (e.g. server) #59

Closed
@JackMordaunt

Description

@JackMordaunt

When you run task example -w for processes that complete everything is as expected: task will re-run example on file changes.

When example is starting a server (for example), something that never exits or 'completes', task will not re-run example on file changes. In other words the long running process blocks task from watching files and re-running the task.

Personally I want task to re-compile and run my server on file changes, without needed to Ctrl-C it first.

I'm not sure if the current behaviour is intentional. If I have missed something obvious please let me know.

Thoughts?

Edit: Looking through the source, it seems you could use the context (which is passed all the way to the sh interpreter) to cancel the currently executing command when a file change event comes in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: watcherChanges related to the Taskfile watcher.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions