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

Function copyFile

internal/cli/acul_app_scaffolding.go:534–551  ·  view source on GitHub ↗

Function to copy a file from a source path to a destination path.

(src, dst string)

Source from the content-addressed store, hash-verified

532
533// Function to copy a file from a source path to a destination path.
534func copyFile(src, dst string) error {
535 in, err := os.Open(src)
536 if err != nil {
537 return fmt.Errorf("failed to open source file: %w", err)
538 }
539 defer in.Close()
540
541 out, err := os.Create(dst)
542 if err != nil {
543 return fmt.Errorf("failed to create destination file: %w", err)
544 }
545 defer out.Close()
546
547 if _, err = io.Copy(out, in); err != nil {
548 return fmt.Errorf("failed to copy file contents: %w", err)
549 }
550 return out.Close()
551}
552
553// Function to recursively copy a directory.
554func copyDir(src, dst string) error {

Callers 4

copyProjectTemplateFilesFunction · 0.85
copyDirFunction · 0.85
handleMissingFilesFunction · 0.85
backupAndOverwriteFunction · 0.85

Calls 3

ErrorfMethod · 0.80
CloseMethod · 0.80
CreateMethod · 0.65

Tested by

no test coverage detected