Merge pull request #127 from dagger/local-include-fix

local: fix when include is not specified
This commit is contained in:
Andrea Luzzardi 2021-02-17 18:51:24 -08:00 committed by GitHub
commit fda6da8433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,9 +223,12 @@ func (p *Pipeline) Local(ctx context.Context, op *compiler.Value) error {
return err
}
var include []string
if err := op.Get("include").Decode(&include); err != nil {
return err
if inc := op.Get("include"); inc.Exists() {
if err := inc.Decode(&include); err != nil {
return err
}
}
p.fs = p.fs.Change(func(st llb.State) llb.State {
return st.File(llb.Copy(
llb.Local(dir, llb.FollowPaths(include)),