Fileboy, File Change Monitoring Notification System, written with Go.
For Hot Reload scenarios (typically for developing go projects without having to perform go build manually every time; for example, front-end node packaging) or system monitoring.
## FEATURES
- Minimalist usage and configuration
- Support multiple platforms, Windows/Linux/MacOS
- Supports custom file listening scope, listening for specified folders/not listening for specified folders/specified suffix files
- Support for custom monitoring events (write / rename / remove / create / chmod)
- Support for setting up multiple commands
- Command support variable placeholders
- Supporting redundant task discarding and customizing redundant task scope
Download the compiled binary file of the corresponding platform, rename it `fileboy`, and add it to the system Path.
### SOURCE
Clone project, enter the project directory, run the command:
```shell
## installation dependency
go get-u gopkg.in/fsnotify/fsnotify.v1
go get-u gopkg.in/yaml.v2
## compile
go build
## run
./fileboy
```
## USAGE
The normal operation of fileboy depends on the `filegirl.yaml` configuration, so for the first time in a project, `filegirl.yaml` needs to be initialized.
- Enter the project home directory where you want hot reload;
- Running `fileboy init` will generate `filegirl. yaml` files in this directory.
- View `filegirl. yaml` and modify it to a configuration item suitable for your project.
- Run `fileboy`.
If you define the `command-> exec` command, you can run the `fileboy exec` command to confirm whether it can be executed properly in advance. The system will try to run your custom command.
You can use `fileboy help` to see help info.
## filegirl.yaml
```yaml
core:
# config version code
version: 1
# monitor section
monitor:
# directories to monitor
# test1 listen for the test1 directory in the project directory
# test1/test2 listen for the test1/test2 directory in the project directory
# test1,* listen for the test1 directory in the project directory and all its subdirectories (recursion)
# .,* listen for the project directory and all its subdirectories (recursion)
includeDirs:
- .,*
# Unmonitored directories
# .idea ignore listening to .idea directory and all its subdirectories
exceptDirs:
- .idea
- .git
- .vscode
- node_modules
- vendor
# the suffix of the listener file, which changes the file to execute commands
# .go file changes suffixed with .go execute commands
# .* all file changes execute commands in the command
types:
- .go
# the type of event to listen to. Only when such an event occurs can the command in command be executed
# without this configuration, all events will be monitored by default
# write write file event
# rename rename file event
# remove remove remove file event
# create create file event
# chmod update file permission event (UNIX like)
events:
- write
- rename
- remove
- create
- chmod
command:
# the files monitored have commands that change to be executed
# there can be multiple commands that will be executed in turn
# in case of interactive commands, allow external access to input
# variable placeholders are supported, and the actual values are replaced when the command is run: