Documentation
¶
Overview ¶
Scafall creates new source projects from project templates. Project templates are stored in git repositories and new source projects are created on your local filesystem.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Scafall)
func WithArguments ¶
Set values for each variable as key-value pairs.
func WithOutputFolder ¶
Set the output folder in which to create scaffold a template.
func WithSubPath ¶
Use a sub folder within the template repository as the source for a template.
type Scafall ¶
type Scafall struct { URL string Arguments map[string]string OutputFolder string SubPath string CloneCache string }
Scafall allows programmatic control over the default values for variables. Any provided Arguments cause prompts for the same variable name to be skipped.
func NewScafall ¶
Create a new Scafall with the given options.
func (Scafall) Scaffold ¶
Scaffold accepts url containing project templates and creates an output project. The url can either point to a project template or a collection of project templates.
Example ¶
Create a new project from a project template
s, _ := NewScafall("http://github.com/AidanDelaney/scafall-python-eg.git", WithOutputFolder("python-pi")) s.Scaffold()
Output:
Example (Arguments) ¶
arguments := map[string]string{ "PythonVersion": "python3.10", } s, _ := NewScafall("http://github.com/AidanDelaney/scafall-python-eg.git", WithArguments(arguments), WithOutputFolder("python-pi")) // User is not prompted for PythonVersion s.Scaffold()
Output: