Closed AliSoftware closed 7 years ago
While I've implemented this in this repo, while implementing this on the SwiftGen repo's side (CLI), it becomes a breaking change:
The CLI will look in both the internal templates
directory, but also in the application support templates
directory. If we change the code for how it searches for templates, we should make it consistent for both directories (internal and app support).
This is the patch:
- var path = appSupportTemplatesPath + "\(prefix)-\(templateShortName).stencil"
+ var path = appSupportTemplatesPath + prefix + "\(templateShortName).stencil"
if !path.isFile {
- path = bundledTemplatesPath + "\(prefix)-\(templateShortName).stencil"
+ path = bundledTemplatesPath + prefix + "\(templateShortName).stencil"
Note that if we do that in SwiftGen 5.0, we must not forget to update the help message for swiftgen templates list
accordingly as well.
I suggest that instead of having all templates flatten in a big
templates
directory, we should makeimages
/fonts
/colors
/ … subdirectories.Especially since now that we'll have a dedicated repository to host templates, that would help organise them.
But also that would allow that directory structure to map the future directory structure for the template documentation which I intend to structure similarly.