Repository navigation
Ask for placeholders, template init, templates from Git - #7
Merged
Merged
Conversation
Templates declare placeholders in .foundry.yaml (vars) and Foundry asks for them in a terminal; --strict stops before writing when a value is missing. template init creates a skeleton. template add accepts a Git address and keeps a copy that update fast-forwards; setup commands of such templates are never run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three things that make templates nicer to write and use:
.foundry.yaml(vars:with a prompt and a default). In a terminal Foundry asks; with--non-interactivethe default is used; any other placeholder that is used but has no value is asked for as well.--strictstops before writing anything when a value is missing (for CI).foundry template init <folder>creates the skeleton of a new template (--add <name>saves it right away).foundry template add <name> <git-address>keeps a copy of a template from Git (--branch);template updatefast-forwards it andtemplate removedeletes the copy. Thepostcommands of such a template are never run.Tested
Unit and CLI tests for declared variables (default,
--varwins, missing reported, asking only for what is missing),--strictwriting nothing, the skeleton working as a template, adding from a Git address with a real local repository, updating it, not running its setup commands and removing only Foundry's own copy.