Add the initial rough skeleton for a config tool.
This commit is contained in:
parent
8d2b15a7c8
commit
1ac689cd04
3 changed files with 49 additions and 1 deletions
|
@ -50,7 +50,7 @@ func getConfigFilePaths(directory string) ([]string, error) {
|
|||
if err != nil {
|
||||
return nil, errors.New("failed to create config directory at " + directory)
|
||||
} else {
|
||||
return nil, errors.New("no config files found at " + directory)
|
||||
return nil, &EmptyConfigError{directory}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,5 +63,9 @@ func getConfigFilePaths(directory string) ([]string, error) {
|
|||
paths = append(paths, filepath.Join(directory, file.Name()))
|
||||
}
|
||||
|
||||
if len(paths) == 0 {
|
||||
return nil, &EmptyConfigError{directory}
|
||||
}
|
||||
|
||||
return paths, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue