iqomp/watcher

A composer plugin to run cli script when it detect some file changes

Maintainers

Details

github.com/iqomp/watcher

Source

Issues

Installs: 511

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:composer-plugin

1.1.3 2024-04-01 03:10 UTC

This package is auto-updated.

Last update: 2024-04-23 05:39:34 UTC


README

A composer plugin to run cli script when it detect some file changes on working directory. This plugin really help on developing some application with self server like swoole where you need to restart the server on every file update.

Installation

composer require iqomp/watcher --dev

Usage

This module add new composer command named watch that will watch for file changes on current directory recursively, and run the provided argument as a script.

composer watch "php index.php start" --ignore="runtime" --ignore="cache"

Above script will run php index.php start on the first run, and watch for file changes in current directory while ignoring directory runtime and cache relative to current directory. When file changes found, the previous script process get killed and new process is executed.