Banji Watcher is a robust file monitoring tool designed to observe changes in your Go project files. Once it detects a modification, it automatically restarts the specified Go executable, ensuring that your development environment is always up to date with the latest changes.
- Automatic Restart: Automatically restarts the Go executable when a monitored file is changed.
- Flexible Configuration: Allows configuration through various options to tailor the watcher to your specific needs.
To use Banji Watcher, you need to configure it with the path to the Go executable you want to monitor or let it auto-detect the first executable with a main function (excluding any file containing banji.Run()).
banji.Flags: Set command-line flags for the Go executable. Example:[]string{"-dev"}banji.MainFuncDirectory: Specify the directory of the main function if it's different from the root. Example:"cmd/server/runserver.go"
- Set Configuration: Configure
banjiwith the necessary options:banji.Flags = []string{"-dev"} banji.MainFuncDirectory = "cmd/server/runserver.go"
- Run the Watcher:
banji.Run()
If no executable path is provided, Banji Watcher will search the project directory for the first file containing a main function and use it, provided banji.Run() is not present in that file.
- Go installed on your system.
To set up Banji Watcher, clone this repository and compile the code:
git clone [repository-url]
cd [repository-directory]
go buildThis project is licensed under the MIT License.