work

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChdirFlag

func ChdirFlag(cmd *cobra.Command, opts *ChdirOptions, value string) error

Types

type ChdirOptions

type ChdirOptions struct {
	// contains filtered or unexported fields
}

func NewChdirOptions

func NewChdirOptions(d string) ChdirOptions

func (ChdirOptions) Chdir

func (o ChdirOptions) Chdir(ctx context.Context) error

func (ChdirOptions) Cwd

func (o ChdirOptions) Cwd(ctx context.Context) (Directory, error)

type Directory

type Directory string

A Directory defines a path to a valid, existing directory on the local filesystem

func Cwd

func Cwd() (work Directory, err error)

Cwd returns a Directory pointing to the current working directory

func Git

func Git(ctx context.Context) (work Directory, err error)

Git returns a Directory pointing to the git repository closest to the current working directory

func Load

func Load(ctx context.Context) (work Directory, err error)

Load returns a Directory pointing to the first directory able to be resolved without error.

Load will attempt directories in the following order:

func (Directory) Path

func (c Directory) Path() string

Path returns the Directory path as a string

Jump to

Keyboard shortcuts

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