marco-silveira / wtc

WTC is a simple utility you can use to watch files and execute commands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WTC

Actions Status Go Report Card GoDoc License

WTC is a simple utility you can use to watch files and execute commands.

Install

Latest Release
$ curl -sfL --silent https://github.com/rafaelsq/wtc/releases/latest/download/wtc.linux64.tar.gz | tar -xzv && mv wtc $(go env GOPATH)/bin/

Compile from source

Before you begin, ensure you have installed the latest version of Go. See the Go documentation for details.

$ go get -u github.com/rafaelsq/wtc

Usage

USAGE:
$ wtc [[flags] regex command]

If [.]wtc.yaml exists, it will be used.

FLAGS:
  -debounce int
    	global debounce (default 300)
  -ignore string
    	regex
  -no-trace
    	disable messages.

Example

wtc "_test\.go$" "go test -cover {PKG}"

Usage with [.]wtc.yaml

You can configure WTC by creating an YAML file with your own rules.

Example:

no_trace: false
debounce: 300  # if rule has no debounce, this will be used instead
ignore: "\\.git/"
trig: buildNRun  # will run on start
rules:
  - name: buildNRun
    match: "\\.go$"
    ignore: "_test\\.go$"
    command: "go build"
    trig: run
  - name: run
    command: "./$(basename `pwd`)"
  - name: test
    match: "_test\\.go$"
    command: "go test -cover {PKG}"

Dev

$ make will watch for changes and run go install

debounce: 100
ignore: "\\.git/"
trig: install
rules:
  - name: install
    match: "\\.go$"
    command: "go install"

About

WTC is a simple utility you can use to watch files and execute commands.

License:MIT License


Languages

Language:Go 99.7%Language:Makefile 0.3%