Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add more --template-dir options #50

Closed
theory opened this Issue · 4 comments

2 participants

@theory
Owner

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
Owner

@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
Owner

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

very excited for this feature. thanks.

@theory theory referenced this issue from a commit
@theory 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.
63aee12
@theory theory closed this in d3a17d0
@theory
Owner

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
Something went wrong with that request. Please try again.