config

package
v0.0.0-...-8c29073 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config implements dotfiles config parser

Index

Constants

This section is empty.

Variables

View Source
var ConfigDir string

ConfigDir is abs path to directory containing config file

View Source
var ConfigFile string

ConfigFile is absolute path to config file

View Source
var HomeDir string

HomeDir is abs path to home directory

View Source
var WorkingDir string

WorkingDir is abs path to working directory containing config file

Functions

func Init

func Init()

Init uses the following precedence order to find config file. Each item takes precedence over the item below it:

  • `--config` / `-c` flag
  • `DOTFILES_CONFIG` environment variable
  • `.dotfilesrc` file in working directory

func Load

func Load(bytes []byte) (map[string][]string, error)

Load reads and unmarshals given config content

func LoadDefault

func LoadDefault() (map[string][]string, error)

LoadDefault reads and unmarshals config file using precedence order from Init()

func MustLoad

func MustLoad(bytes []byte) map[string][]string

MustLoad is like Load but panics in case of error

Types

This section is empty.

Jump to

Keyboard shortcuts

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