Skip to content

Commit

Permalink
i think it might work now
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpect committed Aug 14, 2024
1 parent 0b36f3a commit c51be64
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions pkg/staging/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ func copy(src llb.State, srcPath string, dest llb.State, destPath string) llb.St
}))
}

// func copyForStates(src llb.State, dst llb.State, srcpaths []string, dstpath string) llb.State {
// return dst.With(
// copyMultiple(src, srcpaths, dstpath),
// )
// }

// func copyMultiple(src llb.State, srcPaths []string, destPath string) llb.StateOption {
// var stateOptions []llb.StateOption
// for _, srcPath := range srcPaths {
// stateOptions = append(stateOptions, copyFrom(src, srcPath, destPath))
// }

// return func(s llb.State) llb.State {
// for _, stateOption := range stateOptions {
// s = stateOption(s)
// }
// return s
// }
// }
func copyForStates(src llb.State, dst llb.State, srcpaths []string, dstpath string) llb.State {
return dst.With(
copyMultiple(src, srcpaths, dstpath),
)
}

func copyMultiple(src llb.State, srcPaths []string, destPath string) llb.StateOption {
var stateOptions []llb.StateOption
for _, srcPath := range srcPaths {
stateOptions = append(stateOptions, copyFrom(src, srcPath, destPath))
}

return func(s llb.State) llb.State {
for _, stateOption := range stateOptions {
s = stateOption(s)
}
return s
}
}

0 comments on commit c51be64

Please sign in to comment.