Run is a command line application that monitors specified directories for file changes and executes user-defined commands, facilitating development automation processes. It allows you to automate builds, restart programs, and gain insights into command execution through a verbose mode.
To install Run, follow these steps:
-
Clone the repository:
git clone git@github.com:d3code/run.git
-
Navigate to the project directory:
cd run
-
Build and install the application:
go install ./cmd/run
Run offers various flags to tailor the monitoring behavior and execution of commands. Here are the available flags:
-
-v, --verbose
: Show additional information about command execution. -
-d, --directory
: Specify directories to watch (default: current directory). -
-e, --extension
: Specify extensions to watch (default: none). -
-i, --ignore
: Specify files or sub-directories to ignore (default:.git
and.idea
directories). -
-c, --command
: Specify the command to run and restart on file change.
Monitor .go
files in the current directory and run main.go
on changes:
run -r "go run main.go" -e .go
Monitor .go
files in the current and another directory, ignore .git
, .idea
and bin
folders,
and run a custom command:
run \
-d . \
-d ../other-module \
-e ".go" \
-r "go build -o bin/server ./cmd/server;bin/server" \
-r "cd ../other-module;go build -o bin/server ./cmd/server;bin/server" \
-i ".git",".idea","bin"
Note that you can specify multiple directories and commands to run. Run will execute the commands in the order they are specified.
Contributions to Run are welcome! If you'd like to contribute, please follow the guidelines mentioned in the CONTRIBUTING.md file.
Run is licensed under the MIT License.