commands

package
v0.0.0-...-673a6df Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

PATH type handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitApplication

func ExitApplication(output string)

func Which

func Which(command string) (string, error)

Types

type GitCmd

type GitCmd struct {
	Path       *Path
	Cwd        string
	Command    string
	CommandMap map[string]string
}

GitCmd object for git

func NewGitCmd

func NewGitCmd() *GitCmd

NewGitCmd create a new git object

func (GitCmd) Branch

func (g GitCmd) Branch() string

Branch function returning the current git branch

func (GitCmd) Commit

func (g GitCmd) Commit(message string, args ...string) ([]string, []string, error)

func (GitCmd) Execute

func (g GitCmd) Execute(args ...string) ([]string, []string, error)

func (GitCmd) Prefix

func (g GitCmd) Prefix() string

func (GitCmd) Root

func (g GitCmd) Root() string

Root function returning the git root

func (GitCmd) URL

func (g GitCmd) URL() string

Aliasses URL function returning the git url

type Path

type Path struct {
	Type        string
	Home        string
	Directories []string
}

func NewPath

func NewPath(pathname string) *Path

func (*Path) AppendPath

func (p *Path) AppendPath(inputdir string) error

AppendPath append a path to the list of Directories

func (Path) HavePath

func (p Path) HavePath(inputdir string) bool

func (*Path) Import

func (p *Path) Import(path string)

func (Path) IsEmpty

func (p Path) IsEmpty() bool

func (Path) Lookup

func (p Path) Lookup(target string) (string, error)

func (Path) LookupMulti

func (p Path) LookupMulti(targets ...string) (string, error)

func (Path) LookupPlatform

func (p Path) LookupPlatform(pathmap map[string]string) (string, error)

LookupPlatform lookup paths based on platform

func (Path) MapGetPlatform

func (p Path) MapGetPlatform(pathmap map[string]string) (string, error)

func (Path) Prefix

func (p Path) Prefix() string

func (*Path) PrependPath

func (p *Path) PrependPath(inputdir string) error

func (Path) ReturnExport

func (p Path) ReturnExport() string

Jump to

Keyboard shortcuts

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