github.com/kyma-project/kyma/components/asset-store-controller-manager@v0.0.0-20191203152857-3792b5df17c5/internal/loader/single_loader.go (about)

     1  package loader
     2  
     3  import (
     4  	"path/filepath"
     5  )
     6  
     7  func (l *loader) loadSingle(src, name string) (string, []string, error) {
     8  	basePath, err := l.ioutilTempDir(l.temporaryDir, name)
     9  	if err != nil {
    10  		return "", nil, err
    11  	}
    12  
    13  	fileName := l.fileName(src)
    14  	destination := filepath.Join(basePath, fileName)
    15  	err = l.download(destination, src)
    16  	if err != nil {
    17  		return "", nil, err
    18  	}
    19  
    20  	return basePath, []string{fileName}, nil
    21  }