Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Reorganize templates in subdirectories #1

Closed
AliSoftware opened this issue Jan 4, 2017 · 2 comments
Closed

Reorganize templates in subdirectories #1

AliSoftware opened this issue Jan 4, 2017 · 2 comments

Comments

@AliSoftware
Copy link
Collaborator

I suggest that instead of having all templates flatten in a big templates directory, we should make images/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.

@djbe
Copy link
Member

djbe commented Jan 30, 2017

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 templatesdirectory. 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"

@AliSoftware
Copy link
Collaborator Author

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.

@AliSoftware AliSoftware modified the milestone: SwiftGen 5.0 (breaking) Feb 19, 2017
@djbe djbe closed this as completed in #13 May 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants