config

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoticeColor = "\033[1;36m%s\033[0m"
)

Variables

View Source
var (
	// COMMANDS is a top-level directive. Includes all commands to run
	COMMANDS = "commands"
	SHELL    = "shell"
	ENV      = "env"
	EvalEnv  = "eval_env"
	MIXINS   = "mixins"
	VERSION  = "version"
)

Functions

func GetDefaultConfigPath

func GetDefaultConfigPath() string

func Validate

func Validate(config *Config, letsVersion string) error

Validate loaded config

Types

type Config

type Config struct {
	// absolute path to work dir - where config is placed
	WorkDir  string
	FilePath string
	Commands map[string]command.Command
	Shell    string
	Env      map[string]string
	Version  string

	// absolute path to .lets
	DotLetsDir string
	// contains filtered or unexported fields
}

Config is a struct for loaded config file

func Load

func Load(pathInfo PathInfo, letsVersion string) (*Config, error)

Load a config from file

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a config

type ParseError

type ParseError struct {
	Path struct {
		Full  string
		Field string
	}
	Err error
}

func (*ParseError) Error

func (e *ParseError) Error() string

type PathInfo added in v0.0.23

type PathInfo struct {
	Filename string
	AbsPath  string
	WorkDir  string
}

func FindConfig added in v0.0.23

func FindConfig() (PathInfo, error)

FindConfig will try to find best match for config file. Rules are: - if specified LETS_CONFIG - try to load only that file - if specified LETS_CONFIG_DIR - try to look for a config only in that dir - don't do recursion - if not specified any of env vars above - try to find config recursively

Jump to

Keyboard shortcuts

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