Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store custom templates in ApplicationSupport #42

Closed
AliSoftware opened this issue Oct 26, 2015 · 1 comment · Fixed by #50
Closed

Store custom templates in ApplicationSupport #42

AliSoftware opened this issue Oct 26, 2015 · 1 comment · Fixed by #50

Comments

@AliSoftware
Copy link
Collaborator

The idea of this feature would be to:

  • Create a swiftgen template subcommand that could:
    • with no parameter: list all the installed templates in ~/Library/Application Support/SwiftGen/templates
    • --add FILE copy FILE into ~/Library/Application Support/SwiftGen/templates to install it as template
    • --open: Opens ~/Library/Application Support/SwiftGen/templates in the Finder
  • Add an option parameter to all swiftgen subcommands to specify template by name
    • The option flag will be something like --templateName NAME / -n NAME
    • It will search for a template named NAME.stencil in ~/Library/Application Support/SwiftGen/templates first
    • If not found, It will search for a template named NAME.stencil in the bundled templates (installed in TEMPLATES_RELATIVE_PATH)

This will allow people to store/manage/use their SwiftGen templates in an easier way, instead of having to use the full path with --template each time. Note that the --template option will still work, and using both options should lead to an error.

See also #31 (comment)

@AliSoftware
Copy link
Collaborator Author

Also note that --template will now default to nil and the value having a default will now be --templateName instead.
For example, for swiftgen colors, specifying neither --template nor --templateName would default to the same as using --templateName default

The positive side effect that this would have is that people would be able to simply store their preferred default template for swiftgen colors simply in ~/Library/Application Support/SwiftGen/templates/colors-default.stencil and it will be picked by default instead of the one bundled with SwiftGen. This way, no need to specify --templateName each time if you have your own custom default templates!

AliSoftware added a commit that referenced this issue Nov 2, 2015
…ate path

This version doesn't search for templates in Application Support yet, only in bundled templates.
AliSoftware added a commit that referenced this issue Nov 4, 2015
Fix #42 — Make it easy to specify custom templates by name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant