feat(VCS): git.auto_commit
This commit is contained in:
parent
d5fb28b711
commit
63e2cc55a0
2 changed files with 318 additions and 24 deletions
|
|
@ -35,6 +35,7 @@ type Config struct {
|
|||
DisplayAsciiArt bool `toml:"display_ascii_art"`
|
||||
Key KeyConfig `toml:"key"`
|
||||
Store StoreConfig `toml:"store"`
|
||||
Git GitConfig `toml:"git"`
|
||||
}
|
||||
|
||||
type KeyConfig struct {
|
||||
|
|
@ -47,6 +48,10 @@ type StoreConfig struct {
|
|||
AlwaysPromptDelete bool `toml:"always_prompt_delete"`
|
||||
}
|
||||
|
||||
type GitConfig struct {
|
||||
AutoCommit bool `toml:"auto_commit"`
|
||||
}
|
||||
|
||||
var (
|
||||
config Config
|
||||
asciiArt string = ` ▄▄
|
||||
|
|
@ -76,6 +81,9 @@ func defaultConfig() Config {
|
|||
DefaultStoreName: "default",
|
||||
AlwaysPromptDelete: true,
|
||||
},
|
||||
Git: GitConfig{
|
||||
AutoCommit: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -120,6 +128,10 @@ func loadConfig() (Config, error) {
|
|||
cfg.Key.AlwaysPromptOverwrite = defaultConfig().Key.AlwaysPromptOverwrite
|
||||
}
|
||||
|
||||
if !md.IsDefined("git", "auto_commit") {
|
||||
cfg.Git.AutoCommit = defaultConfig().Git.AutoCommit
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue