2023-09-04 09:55:01 +00:00
|
|
|
package paths
|
2023-04-12 14:17:13 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Paths struct {
|
|
|
|
// ConfigFilePath holds the path to the configuration file that
|
|
|
|
// described the resource that this type is embedded in.
|
|
|
|
ConfigFilePath string `json:"-" bundle:"readonly"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Paths) ConfigFileDirectory() (string, error) {
|
|
|
|
if p.ConfigFilePath == "" {
|
|
|
|
return "", fmt.Errorf("config file path not configured")
|
|
|
|
}
|
|
|
|
return filepath.Dir(p.ConfigFilePath), nil
|
|
|
|
}
|