### What are you trying to do? I find myself writing code like this lately: ```go dir := dag.Directory() for _, file := range files { dir = dir.WithFile("", file) } ``` I'd like to see a shorthand where I can easily add a list of files to a directory: ```go dir := dag.Directory().WithFiles(files...) // OR: WithFiles(files) ``` ### Why is this important to you? When using CLI tools (or even in Dockerfiles) files and directories are usually described by a path without having to make a distinction between them. It's not the case in Dagger, but in many cases a list of files (result of some build step) may be better represented as a directory (archiving). ### How are you currently working around this? See code snippet above.
Activity
tomasmota commentedon Jan 23, 2024
If the maintainers are ok with this suggestion I'd like to try implementing it
helderco commentedon Jan 23, 2024
+1 from me. In the meantime you can make a util:
jedevc commentedon Feb 14, 2024
@sagikazarmark @helderco @tomasmota WDYT about the idea of a
withoutFilesproperty?Currently, there's not really a way of removing multiple files, might be nice to have something like that as well.
helderco commentedon Feb 14, 2024
Yes, sgtm 👍