extend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package extend finds the extensions a project or user adds to mutti without changing it: custom commands in .mutti/commands.

Index

Constants

View Source
const HostDir = "host"

HostDir is the directory of commands that run on the host; every other directory under commands/ is the name of the service its commands run in.

Variables

This section is empty.

Functions

func FindProjectDir

func FindProjectDir(dir string) (string, bool)

FindProjectDir returns the .mutti directory of the project containing dir: the closest one on the way up, not beyond the directory holding .git. ok is false if there is none.

func Interpreter

func Interpreter(script []byte) string

Interpreter is the shell that runs a service command's script: bash if its shebang names bash, sh otherwise.

Types

type Command

type Command struct {
	Name    string // command name as typed: <file> or, when ambiguous, <dir>:<file>
	Service string // service to run in; empty: the host
	Path    string // script file
	Short   string // one-line help: the first "# " comment
}

Command is one custom command.

func Commands

func Commands(reserved []string, dirs ...string) (cmds []Command, shadowed []string, err error)

Commands lists the custom commands of the given .mutti directories, later ones overriding earlier ones (user dir first, project dir last). reserved names (built-in commands) are skipped and reported in shadowed.

Jump to

Keyboard shortcuts

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