trig

package module
v0.0.0-...-6175f58 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: Unlicense Imports: 11 Imported by: 0

README

trig

This command-line tool extends CodeKit by remembering associations between triggering files (template files) and dependent files (which are including those templates). After a file was modified, you call trig, e.g., trig handle footer.html (this call typically happens in a CodeKit hook). Since trig knows exatcly which files include footer.html (this should be automated) it asks CodeKit via AppleScript to process each of those dependent files. (Associations are stored in ~/.trig/associations.db.)

Usage

trig <command> [<args>...]
trig set <dependent-file> <triggering-file-1> <triggering-file-2>...
trig set <dependent-file>
trig handle <triggering-file>
trig list
trig help

Commands:

  • set: Associates a dependent file with triggering filess. If a currently associated triggering file is not mentioned, that association is removed. If no triggering files are provided then all are removed.
  • list: List associations.
  • handle: Executes the registered command on all dependent files that were associated with the provided triggering file.
  • help: Prints the help screen.

Examples:

$ trig register .go 'go run $1'

$ trig set www/index.go templates/one.gohtml templates/two.gohtml

$ trig set www/index.go

$ trig handle templates/two.gohtml

$ trig list

Install

$ go get github.com/zengabor/trig

Author

Gabor Lenard

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBFileName

func DBFileName() string

func GetFullPath

func GetFullPath(pathToFile string) (string, error)

func Handle

func Handle(triggeringFileName string)

func List

func List()

func Set

func Set(dependentFileName string, triggeringFileNames []string)

Types

type Association

type Association struct {
	TriggeringFileName string
	DependentFileNames []string
}

Directories

Path Synopsis
cmd
trig command

Jump to

Keyboard shortcuts

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