eye

command module
v0.0.0-...-00235aa Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

Logo of the project

Eye

Simple file watcher

Eye watches file pattern regex and executes a command on changes.

Synopsis

With an .eyerc file present.

eye

With command line arguments.

eye [-R] -p <regex_pattern> -c <command>

Eye will search for an .eyerc file in current directory or in the home directory. If present it will load the settings. Any command line parameters will override the resource file settings.

Example Usage
eye -r -p '\.go$' -c 'go build'

Watch files in current directory with extension .go and execute go build on changes:

To use for Golang development the eye-go.sh can be used as command.

Copy eye-go.sh to your Golang project directory and change it to suit your needs. Then issue the command:

eye -p '\.go$' -c './eye-go.sh -i 500'

Eye will watch all Go files in current directory and below for changes every half second. If any matching files changes the eye-go.sh script will be executed. The script will build, lint, vet, and look for TODOs in the project. Flags:

  • -h | --help - print usage information.
  • -p <regex_pattern> - matching pattern for files to watch, mandatory.
  • -c <command> - the command to execute on changes, mandatory.
  • -R - do not recurse sub directories, optional.
  • -i <milliseconds> - number of milli seconds to wait between checks, default value 1000 ms (1 s).
Resource file

Resource file format is simple, just a : separated list of key and value. Lines starting with ! is considered to be comments and empty lines are ignored.

Example resource file with all possible settings:

! Eye resource file
pattern: \.go$
command: go test ./...
recursive: true
interval-millis: 500

Installing

git clone https://github.com/callerobertsson/eye.git
cd eye
go install

Licensing

The code in this project is licensed under GPLv3 license.

Documentation

Overview

Package main implements Eye, a simple file change command executioner

Directories

Path Synopsis
Package params defines the Params data type and functions
Package params defines the Params data type and functions
Package resources implements the Resources data type and functions
Package resources implements the Resources data type and functions
Package watcher Status data type Package watcher defines the type that watches the files for changes matching a pattern in a file structure on an interval
Package watcher Status data type Package watcher defines the type that watches the files for changes matching a pattern in a file structure on an interval

Jump to

Keyboard shortcuts

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