globals

package
v0.0.0-...-b0e404d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachOwnWriters

func AttachOwnWriters(cmd *exec.Cmd)

func EnsureDir

func EnsureDir(path string)

func ExpandTilde

func ExpandTilde(path string) (string, error)

Types

type Conf

type Conf struct {
	BaseDir  string    `yaml:"base_dir"`
	Projects []Project `yaml:"projects"`
}

func (Conf) Dir

func (c Conf) Dir(proj Project, repo Repo) string

func (Conf) GetProject

func (c Conf) GetProject(name string) (Project, bool)

func (*Conf) RemoveProject

func (c *Conf) RemoveProject(name string)

func (*Conf) SetProject

func (c *Conf) SetProject(name string, newP Project)

Can also be used to rename a project by giving the old name for the name parameter but using the new name within the proj struct

func (Conf) Validate

func (c Conf) Validate() error

type G

type G struct {
	Config  string           `short:"c" type:"path" help:"Path to config/projects file" default:"~/.config/projects.yaml"`
	Version kong.VersionFlag `short:"v"`
	Conf    Conf             `kong:"-"`
}

func (*G) AfterApply

func (g *G) AfterApply() error

func (*G) WriteConf

func (g *G) WriteConf() error

type Project

type Project struct {
	Name  string `yaml:"name"`
	Repos []Repo `yaml:"repos,omitempty"`
}

func (Project) RemoveFromDisk

func (p Project) RemoveFromDisk(baseDir string) error

type Repo

type Repo struct {
	Name string `yaml:"name"`
	Url  string `yaml:"url"`
}

Jump to

Keyboard shortcuts

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