Skip to content

Commit

Permalink
Add ability to load a config from a given path (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender authored Sep 10, 2024
1 parent ba0c351 commit 9298d82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func GetChiaConfig() (*ChiaConfig, error) {
return nil, fmt.Errorf("chia config file not found at %s. Ensure CHIA_ROOT is set to the correct chia root", configPath)
}

return LoadConfigAtRoot(configPath, rootPath)
}

// LoadConfigAtRoot loads the given configPath into a ChiaConfig
// chiaRoot is required to fill the database paths in the config
func LoadConfigAtRoot(configPath, rootPath string) (*ChiaConfig, error) {
configBytes, err := os.ReadFile(configPath)
if err != nil {
return nil, err
Expand Down

0 comments on commit 9298d82

Please sign in to comment.