MCPcopy Create free account
hub / github.com/nhost/nhost / EditFile

Function EditFile

cli/cmd/config/edit.go:46–61  ·  view source on GitHub ↗
(ctx context.Context, editor, filepath string)

Source from the content-addressed store, hash-verified

44}
45
46func EditFile(ctx context.Context, editor, filepath string) error {
47 cmd := exec.CommandContext(
48 ctx,
49 editor,
50 filepath,
51 )
52 cmd.Stdin = os.Stdin
53 cmd.Stdout = os.Stdout
54 cmd.Stderr = os.Stderr
55
56 if err := cmd.Run(); err != nil {
57 return fmt.Errorf("failed to open editor: %w", err)
58 }
59
60 return nil
61}
62
63func CopyConfig[T any](src, dst, overlayPath string) error {
64 var cfg *T

Callers 2

commandConfigEditFunction · 0.92
editFunction · 0.85

Calls 2

ErrorfMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected