MCPcopy Create free account
hub / github.com/auth0/auth0-cli / handleEditedFiles

Function handleEditedFiles

internal/cli/acul_screen_scaffolding.go:203–231  ·  view source on GitHub ↗
(cli *cli, edited []string, sourceRoot, destRoot string)

Source from the content-addressed store, hash-verified

201}
202
203func handleEditedFiles(cli *cli, edited []string, sourceRoot, destRoot string) error {
204 if len(edited) < 1 {
205 return nil
206 }
207
208 fmt.Println("Edited files/directories may be overwritten:")
209 for _, p := range edited {
210 fmt.Println(" ", p)
211 }
212
213 fmt.Println("⚠️ DISCLAIMER: Some required base files and directories have been edited.\n" +
214 "Your added screen(s) may NOT work correctly without these updates.\n" +
215 "Proceeding without overwriting could lead to inconsistent or unstable behavior.")
216
217 if !prompt.Confirm("Proceed with overwrite and backup? : ") {
218 cli.renderer.Warnf("User opted not to overwrite modified files.")
219 return nil
220 }
221
222 err := backupAndOverwrite(cli, edited, sourceRoot, destRoot)
223 if err != nil {
224 cli.renderer.Warnf("Error during backup and overwrite: %v\n", err)
225 return err
226 }
227
228 cli.renderer.Infof(ansi.Bold(ansi.Blue("Edited files backed up to back_up folder and overwritten.")))
229
230 return nil
231}
232
233// Copy missing files from source to destination.
234func handleMissingFiles(cli *cli, missing []string, tempUnzipDir, sourcePrefix, destDir string) error {

Callers 1

addScreensToProjectFunction · 0.85

Calls 6

ConfirmFunction · 0.92
BoldFunction · 0.92
BlueFunction · 0.92
backupAndOverwriteFunction · 0.85
WarnfMethod · 0.80
InfofMethod · 0.80

Tested by

no test coverage detected