yb

package module
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package yb contains some helpers and wraps goyek/goyek/v2.

Index

Constants

This section is empty.

Variables

View Source
var (
	Define     = goyek.Define
	Main       = boot.Main
	SetDefault = goyek.SetDefault
)
View Source
var (
	GoBin = os.Getenv("GOBIN")
)

Functions

func ContextWithA added in v0.0.5

func ContextWithA(a *A) context.Context

ContextWithA returns a.Context()

func ContextWithLogger added in v0.0.5

func ContextWithLogger(ctx context.Context, logger aLogger) context.Context

ComtextWithLogger returns a context with the logger set.

func GoDeps

func GoDeps(ctx context.Context, name string) []string

GoDeps returns the subpackage names that the given package depends on.

func GoInstall

func GoInstall(ctx context.Context, name string, opts ...InstallOption) (bool, error)

GoInstall go install the given name.

func GoInstallA added in v0.0.7

func GoInstallA(a *goyek.A, opts ...InstallOption)

GoInstallA is GoInstall for a.Name() with a.Context().

func GoShouldBuild

func GoShouldBuild(ctx context.Context, name string) bool

GoShouldBuild reports whether the given package needs compilation.

func Installed added in v0.0.7

func Installed() []string

Installed returns the list of succeessfully installed names.

func LoggerFromContext added in v0.0.5

func LoggerFromContext(ctx context.Context) aLogger

LoggerFromContext returns the logger from the context, or a default slog logger.

func MTime

func MTime(paths ...string) int64

MTime returns the maximum ModTime().UnixMillis() of the given paths.

func PackageName added in v0.0.3

func PackageName(path string) (string, error)

PackageName returns the name of the package at the given path.

func ReadDirLinks(path string) ([]string, error)

ReadDirLinks reads the links contained at path dir.

func ResetInstalled added in v0.0.7

func ResetInstalled()

ResetInstalled empties the installed set.

func Run

func Run(a *goyek.A, progArgs []string, opts ...RunOption)

Run an external program reporting on a.

func TemplateIsOld added in v0.0.9

func TemplateIsOld(ctx context.Context, root string, force bool) (string, error)

TemplateIsOldreports whether the given directory needs qtc/templ to be run.

Types

type A

type A = goyek.A

func AFromContext added in v0.0.5

func AFromContext(ctx context.Context) *A

AFromContext returns A from the Context.

type DefinedTask

type DefinedTask = goyek.DefinedTask

type Deps

type Deps = goyek.Deps

type InstallOption added in v0.0.12

type InstallOption func(*installParams)

func WithForce added in v0.0.11

func WithForce(force bool) InstallOption

func WithRace added in v0.0.11

func WithRace(race bool) InstallOption

type RunOption added in v0.0.12

type RunOption func(*exec.Cmd)

func AtDir

func AtDir(dir string) RunOption

AtDir RunOption sets cmd.Dir.

type Task

type Task = goyek.Task

Jump to

Keyboard shortcuts

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