MCPcopy Index your code
hub / github.com/rilldata/rill / NewHelper

Function NewHelper

cli/pkg/cmdutil/helper.go:65–89  ·  view source on GitHub ↗
(ver version.Version, homeDir string)

Source from the content-addressed store, hash-verified

63}
64
65func NewHelper(ver version.Version, homeDir string) (*Helper, error) {
66 // Create it
67 ch := &Helper{
68 Printer: printer.NewPrinter(printer.FormatHuman),
69 DotRill: dotrill.New(homeDir),
70 HomeDir: homeDir,
71 Version: ver,
72 Interactive: isTerminal(),
73 }
74
75 // Load base admin config from ~/.rill
76 err := ch.ReloadAdminConfig()
77 if err != nil {
78 return nil, err
79 }
80
81 // Load default org
82 defaultOrg, err := ch.DotRill.GetDefaultOrg()
83 if err != nil {
84 return nil, fmt.Errorf("could not parse default org from ~/.rill: %w", err)
85 }
86 ch.Org = defaultOrg
87
88 return ch, nil
89}
90
91func (h *Helper) Close() error {
92 grp := errgroup.Group{}

Callers 2

RunWithInputMethod · 0.92
RunFunction · 0.92

Calls 6

ReloadAdminConfigMethod · 0.95
NewPrinterFunction · 0.92
NewFunction · 0.92
isTerminalFunction · 0.85
GetDefaultOrgMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected