#Check if an entry in the directory is a file or a directory?
1 messages · Page 1 of 1 (latest)
The most straightforward way is to run a WithExec with whichever tool you need to filter what you want.
It is possible to extend Entries to add further options to filter and get more information from te output (https://github.com/moby/buildkit/blob/83b43c683efc36847e19cdb3c058c9d24d22e65f/frontend/gateway/pb/gateway.proto#L24) but that will need its own issue and some discussion before that's implemented
Feels a bit wrong to run another container and exec just to determine that. Haven't fully tested this, but is there any downside to assuming an entry is a directory and grabbing it with .Directory() and if that's nil that mus mean we're dealing with a file. Any edge cases there ?