Compiler recipe now saves the entire tree

This commit is contained in:
Ettore Di Giacinto
2021-04-08 15:22:00 +02:00
parent 83cb6a2804
commit c7b79bf630

View File

@@ -57,6 +57,17 @@ type CompilerRecipe struct {
Recipe
}
// CompilerRecipes copies tree 1:1 as they contain the specs
// and the build context required for reproducible builds
func (r *CompilerRecipe) Save(path string) error {
for _, p := range r.SourcePath {
if err := helpers.CopyDir(p, filepath.Join(path, filepath.Base(p))); err != nil {
return errors.Wrap(err, "while copying source tree")
}
}
return nil
}
func (r *CompilerRecipe) Load(path string) error {
r.SourcePath = append(r.SourcePath, path)