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

Function copyDir

internal/cli/acul_app_scaffolding.go:554–584  ·  view source on GitHub ↗

Function to recursively copy a directory.

(src, dst string)

Source from the content-addressed store, hash-verified

552
553// Function to recursively copy a directory.
554func copyDir(src, dst string) error {
555 sourceInfo, err := os.Stat(src)
556 if err != nil {
557 return err
558 }
559
560 err = os.MkdirAll(dst, sourceInfo.Mode())
561 if err != nil {
562 return err
563 }
564
565 return filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
566 if err != nil {
567 return err
568 }
569 if path == src {
570 return nil
571 }
572
573 relPath, err := filepath.Rel(src, path)
574 if err != nil {
575 return err
576 }
577 destPath := filepath.Join(dst, relPath)
578
579 if info.IsDir() {
580 return os.MkdirAll(destPath, info.Mode())
581 }
582 return copyFile(path, destPath)
583 })
584}
585
586func createScreenMap(screens []Screens) map[string]Screens {
587 screenMap := make(map[string]Screens)

Callers 2

copyTemplateBaseDirsFunction · 0.85
copyProjectScreensFunction · 0.85

Calls 1

copyFileFunction · 0.85

Tested by

no test coverage detected