github.com/databricks/cli@v0.203.0/bundle/config/resources/pkg.go (about)

     1  package resources
     2  
     3  import (
     4  	"fmt"
     5  	"path/filepath"
     6  )
     7  
     8  type Paths struct {
     9  	// ConfigFilePath holds the path to the configuration file that
    10  	// described the resource that this type is embedded in.
    11  	ConfigFilePath string `json:"-" bundle:"readonly"`
    12  }
    13  
    14  func (p *Paths) ConfigFileDirectory() (string, error) {
    15  	if p.ConfigFilePath == "" {
    16  		return "", fmt.Errorf("config file path not configured")
    17  	}
    18  	return filepath.Dir(p.ConfigFilePath), nil
    19  }