Add Flexlate to a Project Already Generated from a Template¶
This guide covers taking
a project that was previously generated from a template using
cookiecutter
or copier
and hooking it up with Flexlate to enable updating.
If you want to create a new project with Flexlate, you should follow
the new project guide.
If you want to use Flexlate to add new templates within an existing
project that was not generated from cookiecutter
or copier
, you
should follow the add to project guide.
fxt bootstrap
¶
The fxt bootstrap
command is used
to bootstrap a project that was previously generated from a template
so that it can be used with Flexlate.
$ ls 'my answer.txt' woo.txt $ fxt bootstrap https://github.com/nickderobertis/copier-simple-example Bootstrapping /tmp/tmp33iywuos into a Flexlate project based off the template from https://github.com/nickderobertis/copier-simple-example Initializing flexlate project with default add mode local and user=False in /tmp/tmp33iywuos ⠋ Initializing... ⠋ Initializing... ⠙ Initializing... ✔ Finished initializing flexlate project Adding template source... Adding template source copier-simple-example from https://github.com/nickderobertis/copier-simple-example ⠋ ⠙ Sucessfully added template source copier-simple-example ⠙ ⠙ Applying template copier-simple-example to /tmp/tmp33iywuos Updating 1 applied templates question1? Format: yaml my answer The second question question2? Format: float 10 create my answer.txt create temp.txt ✔ Successfully updated template output ✔ Successfully applied template copier-simple-example to /tmp/tmp33iywuos ✔ Successfully bootstrapped /tmp/tmp33iywuos into a Flexlate project based off the template from https://github.com/nickderobertis/copier-simple-example $ ls flexlate-project.json flexlate.json 'my answer.txt' woo.txt
We can see that it prompts based on the questions in the template, be sure to enter these exactly as they are in your project to avoid unnecessary merge conflicts.
If your project is not already at the newest version of the template,
you can add the --version
option to pass a specific version.
fxt bootstrap https://github.com/nickderobertis/copier-simple-example --version c7e1ba1bfb141e9c577e7c21ee4a5d3ae5dde04d
See the command reference for full details.
Next Steps¶
See how to update your project to a newer template version.