Add more --template-dir options #50

Closed
theory opened this Issue Oct 17, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@theory
Collaborator

theory commented Oct 17, 2012

First, add a short version of --template-dir to the add command.

But more importantly, add a --template-file option to allow a file to be selected. It should have short options, too.

@theory

This comment has been minimized.

Show comment
Hide comment
@theory

theory Oct 17, 2012

Collaborator

@rdunklau points out that, if we want to support individual template files, we'll need separate --deploy-template, --revert-template, and --test-template options.

Collaborator

theory commented Oct 17, 2012

@rdunklau points out that, if we want to support individual template files, we'll need separate --deploy-template, --revert-template, and --test-template options.

@theory

This comment has been minimized.

Show comment
Hide comment
@theory

theory Apr 30, 2013

Collaborator

Bit of background: The idea here is to allow users to create templates for various typical tasks, like adding a table or defining a function. These templates could define a lot more boilerplate to start with. It will be even more useful when combined with aliases, as suggested in #89:

sqitch config --user alias.add-table add \
  --deploy-template tmpl/deploy/add_table.tt \
  --revert-template tmpl/revert/add_table.tt \
  --verify-template tmpl/refert/add_table.tt
Collaborator

theory commented Apr 30, 2013

Bit of background: The idea here is to allow users to create templates for various typical tasks, like adding a table or defining a function. These templates could define a lot more boilerplate to start with. It will be even more useful when combined with aliases, as suggested in #89:

sqitch config --user alias.add-table add \
  --deploy-template tmpl/deploy/add_table.tt \
  --revert-template tmpl/revert/add_table.tt \
  --verify-template tmpl/refert/add_table.tt
@no0p

This comment has been minimized.

Show comment
Hide comment
@no0p

no0p Apr 30, 2013

very excited for this feature. thanks.

no0p commented Apr 30, 2013

very excited for this feature. thanks.

theory added a commit that referenced this issue Aug 27, 2013

Move templatess to `templates/$action/$engine.tmpl`.
This gives us engine-specific default templates, currently including Postgres
and SQLite templates. The addition of the `--template` option to the `add`
command allows the user to specify a template of any name, which will make
customization much easier.

Still to do:

* Update the docs with the new template names.
* Update the installer to install the templates in the right place.
* Update the installer to move existing templates to subdirectories,
  and emit a message about user- or project-specific custom templates
  needing to be moved, as well.

Ref issue #50.

@theory theory closed this in d3a17d0 Aug 28, 2013

@theory

This comment has been minimized.

Show comment
Hide comment
@theory

theory Aug 28, 2013

Collaborator

So, I did it a bit differently than I originally came up with in this ticket. The description of the changes in d3a17d0 should make it clear(ish) how it works. Please let me know if you experience any issues.

Collaborator

theory commented Aug 28, 2013

So, I did it a bit differently than I originally came up with in this ticket. The description of the changes in d3a17d0 should make it clear(ish) how it works. Please let me know if you experience any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment