MCPcopy Index your code
hub / github.com/apache/devlake / copyContentsToArchive

Function copyContentsToArchive

backend/core/utils/io.go:91–106  ·  view source on GitHub ↗
(archiveType string, absSourcePath string, absArchivePath string)

Source from the content-addressed store, hash-verified

89}
90
91func copyContentsToArchive(archiveType string, absSourcePath string, absArchivePath string) errors.Error {
92 var files []os.DirEntry
93 files, err := os.ReadDir(absSourcePath)
94 if err != nil {
95 return errors.Convert(err)
96 }
97 for _, desPath := range files {
98 archiveDest := desPath.Name()
99 src := fmt.Sprintf("%s/%s", absSourcePath, archiveDest)
100 err = copyToArchive(archiveType, src, absArchivePath, archiveDest)
101 if err != nil {
102 return errors.Convert(err)
103 }
104 }
105 return nil
106}
107
108func copyToArchive(archiveType string, absSourcePath string, absArchivePath string, archiveDest string) errors.Error {
109 src := fmt.Sprintf("file://%s", absSourcePath)

Callers 1

createArchiveFunction · 0.85

Calls 3

copyToArchiveFunction · 0.85
NameMethod · 0.65
ConvertMethod · 0.45

Tested by

no test coverage detected