Unable to load files content in the loop
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
**Bicep version**
v0.40.2
**Describe the bug**
When try to list files and load content in the loop it works properly when there is only one file in directory as on screen:
Unfortunately, when we have more files same script does not work:
**To Reproduce**
```
//List files
var files = loadDirectoryFileInfo('./Files')
//Map and load file contents
var mapppedFiles = [for item in files:{
fileName: item.baseName
content: loadTextContent(item.relativePath)
}
]
//Output the array of file contents
output fileContents array = mapppedFiles
```
**Additional context**
Need to load all files from directory.
Contributor guide
Research direction
Start by reproducing the issue with the shown loadDirectoryFileInfo and loadTextContent loop, comparing the one-file and multi-file cases. Trace the handling of these load functions and their relativePath values; done means the example loads and outputs content for every file in the directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100