templates

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PATH_TOKEN = "{path}"
View Source
const PROJECT_TOKEN = "{project}"
View Source
const SPACE_TOKEN = "{space}"

Variables

This section is empty.

Functions

func Add added in v0.7.1

func Add(name string, steps []Step) error

func GetTemplateNames

func GetTemplateNames(templates map[string][]Step) []string

func ListTemplates

func ListTemplates() map[string][]Step

func Remove added in v0.7.1

func Remove(name string) error

func Run added in v0.7.1

func Run(template Template, space, project, path string) error

Run goes over each steps of the template and execute them.

Types

type Step

type Step struct {
	Command []string `json:"command"`
	Dir     string   `json:"dir"`
}

Step represents a command to execute in a specific directory.

func FindTemplate

func FindTemplate(name string) ([]Step, bool)

FindTemplate returns the steps associated with a template name, if any was found.

type Template added in v0.7.1

type Template = []Step

func Default added in v0.7.1

func Default() Template

Default returns the default template to add when there is not configuration file yet.

func FromConfig added in v0.7.1

func FromConfig(key string) (Template, error)

func FromFile added in v0.7.1

func FromFile(file *os.File) (Template, error)

Jump to

Keyboard shortcuts

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