blob: 93881f4d4d2d5f85fe962eb0eef0c6b46bb6ec22 [file]
---
title: 'DirectoryExpander'
---
Expands directories created by [`ctx.actions.declare_directory`](/versions/7.7.1/rules/lib/builtins/actions#declare_directory) during the execution phase. This is useful to expand directories in [`map_each`](/versions/7.7.1/rules/lib/builtins/Args#add_all.map_each).
## Members
* [expand](#expand)
## expand
```
list DirectoryExpander.expand(file)
```
If the given `File` is a directory, this returns a list of `File`s recursively underneath the directory. Otherwise, this returns a list containing just the given `File` itself.
### Parameters
| Parameter | Description |
| --- | --- |
| `file` | required The directory or file to expand. |