mirror of
https://github.com/mudler/luet.git
synced 2025-09-25 06:24:46 +00:00
Set path during recipe load
Set path only when the recipe is loaded and not when it gets converted. In such way the internal temporary db knows where the sources where.
This commit is contained in:
@@ -86,22 +86,18 @@ func (r *Recipe) Load(path string) error {
|
||||
|
||||
dat, err := ioutil.ReadFile(currentpath)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "Error reading file "+currentpath)
|
||||
}
|
||||
pack, err := pkg.DefaultPackageFromYaml(dat)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "Error reading yaml "+currentpath)
|
||||
}
|
||||
|
||||
pack.SetPath(filepath.Dir(path))
|
||||
|
||||
// Path is set only internally when tree is loaded from disk
|
||||
pack.SetPath(filepath.Dir(currentpath))
|
||||
_, err = r.Tree().GetPackageSet().CreatePackage(&pack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// first thing to do, check error. and decide what to do about it
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "Error creating package "+pack.GetName())
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user