Fix #20 local configuration is optional

pull/29/head
Mickaël Menu 3 years ago
parent 3889fff457
commit be78def5aa
No known key found for this signature in database
GPG Key ID: 53D73664CD359895

@ -2,7 +2,12 @@
All notable changes to this project will be documented in this file.
<!-- ## Unreleased -->
## Unreleased
### Changed
* The local configuration is not required anymore in a notebook's `.zk` directory.
## 0.3.0

@ -170,6 +170,12 @@ func (c *GroupConfig) Override(overrides ConfigOverrides) {
// OpenConfig creates a new Config instance from its TOML representation stored
// in the given file.
func OpenConfig(path string, parentConfig Config) (Config, error) {
// The local config is optional.
exists, err := paths.Exists(path)
if err == nil && !exists {
return parentConfig, nil
}
content, err := ioutil.ReadFile(path)
if err != nil {
return parentConfig, errors.Wrapf(err, "failed to open config file at %s", path)

Loading…
Cancel
Save