script

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm added in v0.0.2

func Confirm(format string, args ...any)

Confirm prompts the user for a single keypress of y for yes or cancels

func Makefile

func Makefile(tasks ...Task)

Makefile will execute the provided tasks much like make with dependencies, as per the Task behavior declared above

func RepoRoot

func RepoRoot() string

RepoRoot returns the root directory of the repository, typically this found by the .git directory

func Run

func Run(cmd string, args ...run.Option) string

Run executes a shell.Split command, automatically downloading binaries based on configurations such as binny, and executing with the run.Option(s) provided

Types

type Task

type Task struct {
	// Name the name of the tasks, which is used to refer to it everywhere: running, specifying dependencies, etc.
	Name string

	// Description provides a brief summary or purpose of the task
	Description string

	// Dependencies is a list of tasks that will be executed and must complete successfully before this task executes
	Dependencies []string

	// RunsOn when a task in RunsOn is executed, it will cause this task to be executed as a dependency
	RunsOn []string

	// Tasks allows a hierarchy of tasks to be registered together; subtasks will be prefixed with the "<parent name>:",
	// but their name will be added to the phase matching the name itself, so `binny` -> `clean` results in
	// `binny:clean` and `clean` execution for the subtask.
	Tasks []Task

	// Run is the function to execute this task's functionality
	Run func()
}

func (Task) DependsOn

func (t Task) DependsOn(tasks ...string) Task

DependsOn adds the provided task names as dependencies to the current task

func (Task) RunOn

func (t Task) RunOn(tasks ...string) Task

RunOn adds the provided tasks to the RunsOn list

Jump to

Keyboard shortcuts

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