MCPcopy Create free account
hub / github.com/compozy/agh / loadConfigForDisplay

Function loadConfigForDisplay

internal/cli/config.go:830–855  ·  view source on GitHub ↗
(deps commandDeps, workspaceRoot string)

Source from the content-addressed store, hash-verified

828}
829
830func loadConfigForDisplay(deps commandDeps, workspaceRoot string) (aghconfig.Config, string, error) {
831 workspace, err := resolveOptionalConfigWorkspaceRoot(workspaceRoot)
832 if err != nil {
833 return aghconfig.Config{}, "", err
834 }
835 homeWorkspace := workspace
836 if homeWorkspace == "" {
837 homeWorkspace, err = currentWorkingDirectory(deps)
838 if err != nil {
839 return aghconfig.Config{}, "", err
840 }
841 }
842 homePaths, err := deps.resolveHomeForWorkspace(homeWorkspace)
843 if err != nil {
844 return aghconfig.Config{}, "", err
845 }
846 loadOptions := []aghconfig.LoadOption{}
847 if workspace != "" {
848 loadOptions = append(loadOptions, aghconfig.WithWorkspaceRoot(workspace))
849 }
850 cfg, err := aghconfig.LoadForHome(homePaths, loadOptions...)
851 if err != nil {
852 return aghconfig.Config{}, "", err
853 }
854 return cfg, workspace, nil
855}
856
857func configWriteTarget(
858 deps commandDeps,

Callers 3

newConfigShowCommandFunction · 0.85
newConfigListCommandFunction · 0.85
newConfigGetCommandFunction · 0.85

Calls 3

currentWorkingDirectoryFunction · 0.85
appendFunction · 0.85

Tested by

no test coverage detected