aster

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 22 Imported by: 0

README

Aster

Aster is a command line tool to handle events on file system modifications. It is inspired by Guard.

pkg.go.dev GitHub Actions Appveyor Codecov

Installation

$ go install github.com/hattya/aster/cmd/aster@latest

Usage

$ aster -g
init
$ aster init [<template>...]

aster init creates an Asterfile in the current directory if it does not exist, and add specified template files to it.

Template files are located in:

  • UNIX
    $XDG_CONFIG_HOME/aster/template/<template>

  • macOS
    ~/Library/Application Support/Aster/template/<template>

  • Windows
    %APPDATA%\Aster\template\<template>

Asterfile

Asterfile is evaluated as JavaScript by otto.

var go = require('language/go').go;

aster.watch(/.+\.go$/, function() {
  // test
  if (go.test('-v', '-covermode', 'atomic', '-coverprofile', 'cover.out', './...')) {
    return;
  }
  // coverage report
  go.tool.cover('-func', 'cover.out');
  go.tool.cover('-html', 'cover.out', '-o', 'coverage.html');
  // vet
  if (go.vet('./...')) {
    return;
  }
});

Reference

License

Aster is distributed under the terms of the MIT License.

Documentation

Index

Constants

View Source
const Version = "0.4"

Variables

This section is empty.

Functions

This section is empty.

Types

type Aster

type Aster struct {
	// contains filtered or unexported fields
}

func New

func New(ui *cli.CLI, n notify.Notifier) (*Aster, error)

func (*Aster) Eval

func (a *Aster) Eval(src interface{}) (otto.Value, error)

func (*Aster) Ignore

func (a *Aster) Ignore(name string) bool

func (*Aster) OnChange

func (a *Aster) OnChange(ctx context.Context, files map[string]int)

func (*Aster) Reloaded

func (a *Aster) Reloaded() bool

type GNTPValue

type GNTPValue string

func (*GNTPValue) Get

func (g *GNTPValue) Get() interface{}

func (*GNTPValue) IsBoolFlag

func (g *GNTPValue) IsBoolFlag() bool

func (*GNTPValue) Set

func (g *GNTPValue) Set(s string) error

func (*GNTPValue) String

func (g *GNTPValue) String() string

type Watcher

type Watcher struct {
	Squash time.Duration
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(ctx context.Context, a *Aster) (*Watcher, error)

func (*Watcher) Add

func (w *Watcher) Add(name string) error

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Remove

func (w *Watcher) Remove(name string) error

func (*Watcher) Update

func (w *Watcher) Update(name string) error

func (*Watcher) Watch

func (w *Watcher) Watch() error

Directories

Path Synopsis
cmd
internal
sh

Jump to

Keyboard shortcuts

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