config

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigDirectory

func GetConfigDirectory() (string, error)

GetConfigDirectory gets the config directory path for the Pizza CLI. This function should be used to ensure consistency among commands for loading and modifying the config.

Types

type Spec

type Spec struct {

	// Attributions are mappings of GitHub usernames to a list of emails. These
	// emails should be the associated addresses used by individual GitHub users.
	// Example: { github_username: [ email1@domain.com, email2@domain.com ]} where
	// "github_username" has 2 emails attributed to them and their work.
	Attributions map[string][]string `yaml:"attribution"`

	// AttributionFallback is the default username/group(s) to attribute to the filename
	// if no other attributions were found.
	AttributionFallback []string `yaml:"attribution-fallback"`
}

The configuration specification

func LoadConfig

func LoadConfig(path string) (*Spec, string, error)

LoadConfig loads a configuration file at a given path. If the provided path does not exist or doesn't contain a ".sauced.yaml" file, "~/.sauced.yaml" from the fallback path, which is the user's home directory, is used.

This function returns the config Spec, the location the spec was loaded from, and an error

Jump to

Keyboard shortcuts

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