This is a command-line application built in Go for watching file changes and rerunning a specified command when a change is detected.
To get started, clone this repository to your local machine:
git clone https://github.com/dagar-in/goner.git
You will need to have Go installed on your machine to run this application. You can download it from the official website: https://golang.org/dl/
Once you have Go installed, navigate to the project directory and run:
go build
This will build the executable for the application.
To use the application, run the built executable and provide the command you want to run when a file change is detected:
./goner "go run ."
The above command will watch for file changes in the current working directory and any subdirectories up to 10 levels deep. If a change is detected, the specified command (go run .
) will be re-run.
The application accepts the following options:
-d
or--depth
: Set the maximum depth for subdirectories to watch (default: 10).-e
or--exclude
: Specify a comma-separated list of files or directories to exclude from watching.
- Go
- fsnotify - File system notifications for Go