runner

package
v0.0.0-...-8bc1bb3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package runner handles building and running the binary when a file has been modified.

How watching/building/running works:

  • The directory tree starting at the root working directory is walked (recursively).
  • If the directory is not ignored, per the config file settings, an fsnotify watcher is set on each directory to watch for changes to files within that directory.
  • When a file change event occurs, the file is checked to see if it has a watched extension. If yes, the binary is rebuilt and/or rerun as needed.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBuildFailed is returned when a build fails.
	ErrBuildFailed = errors.New("build failed")

	// ErrBuildKilled is returned when a build is killed in the middle of building due
	// to a new change occurred.
	ErrBuildKilled = errors.New("build killed")
)

Functions

func Configure

func Configure() (err error)

Configure handles some initialization steps before watching for file changes and handling building and running the binary.

func Start

func Start()

Start building and running the binary if changes occurred

func Watch

func Watch() (err error)

Watch handles setting up the watcher of file changes. The watcher is populated with a list of directories to watch, not individual files. Some directories are ignored per the config file field DirectoriesToIgnore.

When a file change event occurs, the event is sent on the eventsChan which will be recevied in start() and is used to trigger the binary being built via build().

Types

This section is empty.

Jump to

Keyboard shortcuts

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