rebuild

command module
v0.0.0-...-f7ceb53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 15 Imported by: 0

README

rebuild

rebuild is a command line tool to make it easy to automatically rebuild projects when files change in a directory. e.g., go backend services or tools.

While this project was written to automatically rebuild my go projects, rebuild doesn't make too many assumptions about commands. You can run this with any commandline tool you want.

Install

go get github.com/paydro/rebuild

Usage

Rebuild and run a simple go tool:

rebuild --build 'go build -o mybinary .' -- mybinary

The --build flag is optional if you don't need a build step. For instance, if you'd like to run tests after file changes:

rebuild -- go test ./...

rebuild also works well with projects that run continuously like HTTP servers. In the following example, when a file changes in the current directory, the http binary is built, and executed. When a new change occurs, rebuild will properly kill the old http binary, rebuild the binary, and execute http again.

rebuild --build 'go build -o http .' -- http

Exclude directories:

rebuild --exclude dir1 --exclude dir2 --exclude=dir3,dir4 -- go build .

Watch a different directory than CWD:

rebuild --watch path/to/files -- mybinary
Stop rebuild

Type CTRL+c.

If your command handles termination signals, this will also send SIGTERM to the process.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL