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

Function verifyFile

cli/cmd/config/pull.go:85–103  ·  view source on GitHub ↗
(ce *clienv.CliEnv, name string)

Source from the content-addressed store, hash-verified

83}
84
85func verifyFile(ce *clienv.CliEnv, name string) error {
86 if clienv.PathExists(name) {
87 ce.PromptMessage(
88 "%s",
89 name+" already exists. Do you want to overwrite it? [y/N] ",
90 )
91
92 resp, err := ce.PromptInput(false)
93 if err != nil {
94 return fmt.Errorf("failed to read input: %w", err)
95 }
96
97 if resp != "y" && resp != "Y" {
98 return errors.New("aborting") //nolint:err113
99 }
100 }
101
102 return nil
103}
104
105func respToSecrets(env []*graphql.GetSecrets_AppSecrets, anonymize bool) model.Secrets {
106 secrets := make(model.Secrets, len(env))

Callers 1

commandPullFunction · 0.85

Calls 4

PathExistsFunction · 0.92
PromptMessageMethod · 0.80
PromptInputMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected