config

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Filename names the config file
	Filename = ".bumpy-ride"
)

Variables

This section is empty.

Functions

func GetBytes

func GetBytes() (bv []byte, err error)

GetBytes reads the configuration file and returns its bytes

Types

type Config

type Config struct {
	NoFetch     bool     `json:"noFetch"`
	NoCommit    bool     `json:"noCommit"`
	SaveVersion bool     `json:"saveVersion"`
	NPMPrefixes []string `json:"npmPrefixes"`
}

Config defines the bumpy-ride configuration file

func New

func New() (cfg Config)

New returns an initial Config

func (*Config) Load

func (cfg *Config) Load() (fn git.RestoreCwdFunc, err error)

Load loads the configuration file, which must exist

func (*Config) LoadOrCreate

func (cfg *Config) LoadOrCreate() (created bool, fn git.RestoreCwdFunc, err error)

LoadOrCreate loads the configuration file if it exists, or creates it otherwise

func (*Config) Read

func (cfg *Config) Read() (err error)

Read reads the configuration file

func (*Config) Save

func (cfg *Config) Save() (err error)

Save writes the configuration file

Jump to

Keyboard shortcuts

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