Help us shape the future of Go! Take the 2026 Go Developer Survey

wtc

command module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 1 Imported by: 0

README

WTC

Actions Status Go Report Card 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

$ wtc [[flags] [regex command]]

FLAGS:
  -debounce int
        global debounce (default 300)
  -f string
        wtc config file (default try to find [.]wtc.y[a]ml)
  -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/
format:
  ok: "{{.Time}} \u001b[38;5;2m[{{.Name}}]\u001b[0m - {{.Command}}\n"
  fail: "{{.Time}} \u001b[38;5;1m[{{.Name}}]\u001b[0m - {{.Error}}\n"
trig: [start, buildNRun]  # will run on start
env_file: 'project.env'
env:
  - name: PORT
    value: 2000
rules:
  - name: start
  - name: buildNRun
    match: \.go$
    ignore: _test\.go$
    command: go build
    env:
      - name: development
        value: true
    trig: 
      - done build
      - run
      - test
  - name: done build
  - 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"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
wtc

Jump to

Keyboard shortcuts

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