datum icon indicating copy to clipboard operation
datum copied to clipboard

File type precedence when multiple files in a folder share a name?

Open ChrisLGardner opened this issue 5 years ago • 2 comments

If I've got a structure like below is is possible to say I'd want yml -> psd1 -> json or something similar to let me choose which files should be added to the datum structure?

Nodes
|
|--Node1.yml
|--Node1.json
|--Node1.psd1

The main use case here is that I've got some folders with nodes in them that also contain ARM templates named after the node type, along with config data (which is what I want) and a DSC config. Since all the files match in name Datum is grabbing the json file first, which isn't much use since it's an ARM template.

If I could set a precedence for what file types it should look for first then that would be great, or being able to filter out (or in) file types would be another useful solution.

ChrisLGardner avatar Apr 27 '19 22:04 ChrisLGardner

As a general feature, I agree that could be nice, or maybe just have a global filter to look for specific extension (i.e. only *.yml).

That said, from the general perspective of Configuration Data, I think it's bad practice to have files with the same BaseName, in one same folder.

The Hierarchy of data is your representation of information of your infrastructure, so you should avoid confusion by structuring it in explicit folders. the arm files should probably live in an arm/ subfolder, and maybe just referenced (or its path dynamically deduced/derived by code).

I'll think about it.

gaelcolas avatar Apr 28 '19 05:04 gaelcolas

That's a fair point, we're doing a lot with dev and test labs where as much as possible is broken down into reusable building blocks that are split up by role. Having the ARM templates extracted out from that would be a good idea since there isn't a huge range of difference between the different ones we have, maybe some extra drives here or there.

ChrisLGardner avatar Apr 28 '19 23:04 ChrisLGardner