MCPcopy
hub / github.com/slimtoolkit/slim / fixPy3CacheFile

Function fixPy3CacheFile

pkg/app/sensor/artifact/artifact.go:2933–2953  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

2931}
2932
2933func fixPy3CacheFile(src, dst string) error {
2934 dstPyFilePath := py3FileNameFromCache(dst)
2935 if dstPyFilePath == "" {
2936 return nil
2937 }
2938
2939 srcPyFilePath := py3FileNameFromCache(src)
2940 if srcPyFilePath == "" {
2941 return nil
2942 }
2943
2944 if _, err := os.Stat(dstPyFilePath); err != nil && os.IsNotExist(err) {
2945 //if err := cpFile(srcPyFilePath, dstPyFilePath); err != nil {
2946 if err := fsutil.CopyRegularFile(true, srcPyFilePath, dstPyFilePath, true); err != nil {
2947 log.Debugf("sensor: monitor - fixPy3CacheFile - error copying file => %v", dstPyFilePath)
2948 return err
2949 }
2950 }
2951
2952 return nil
2953}
2954
2955func rbEnsureGemFiles(src, storeLocation, prefix string) error {
2956 if strings.Contains(src, rbDefaultSpecSubDir) {

Callers 1

saveArtifactsMethod · 0.85

Calls 2

CopyRegularFileFunction · 0.92
py3FileNameFromCacheFunction · 0.85

Tested by

no test coverage detected