watchrun

command module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 12 Imported by: 0

README

watchrun is a command-line utility to monitor a directory and run a command when any file in that directory changes. It excludes temporary and hidden files that start with . or ~ or end with ~.

To install from source:

go get github.com/loov/watchrun

Example usage:

$ watchrun go run main.go

Then you can test with:

$ echo package main; main(){ println("hello") } > main.go
$ echo package main; main(){ println("world") } > main.go

You can explicitly specify which folder or file to watch with -monitor:

$ watchrun -monitor ../../ go run main.go
$ watchrun -monitor main.go go run main.go

You can run multiple commands in succession with == (instead of the usual &&). For example:

$ watchrun go build -i . == myproject

Usage

Usage of watchrun:
  -ignore string
        ignore files/folders that match these globs (default "~*;.*;*~;*.exe")
  -interval duration
        interval to wait between monitoring (default 300ms)
  -monitor string
        files/folders/globs to monitor (default ".")
  -recurse
        when watching a folder should recurse (default true)
  -verbose
        verbose output

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
examples

Jump to

Keyboard shortcuts

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