Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Type ActionType
Source kickoff.File
Destination Destination
}
Action defines an action that should be performed on project creation.
type ActionType ¶
type ActionType uint8
ActionType defines the action that should be performed for a given project file, template or directory.
const ( ActionTypeCreate ActionType = iota ActionTypeOverwrite ActionTypeSkipExisting ActionTypeSkipUser )
type Config ¶ added in v0.1.1
type Config struct {
// ProjectName is made available to templates. If empty the basename of the
// target directory is used.
ProjectName string
// Host is the project host, e.g. github.com. Available in templates.
Host string
// Owner is the project owner, e.g. SCM username. Available in templates.
Owner string
// Gitignore template to use for creating .gitignore. If nil, no .gitignore
// is created.
Gitignore *gitignore.Template
// License info for the open source license to use. If nil, no LICENSE file
// is created.
License *license.Info
// If Overwrite is true, existing file in the target directory that matches
// the name of one of the skeleton files is overwritten.
Overwrite bool
// OverwriteFiles can be used to selectively overwrite existing files. File
// paths must be relative to the target directory.
OverwriteFiles []string
// SkipFiles can be used to selectively skip creation of files or
// directories. File paths must be relative to the target directory.
SkipFiles []string
// Filesystem to use for creating the project. Can be set to
// *afero.MemMapFs in tests or for dry running project creation. If nil
// an *afero.OsFs is used.
Filesystem afero.Fs
// Values are user defined values that are merged on top of values from the
// project skeleton.
Values template.Values
// Output configures the io.Writer where the project creation summary is
// written to. If nil output is discarded.
Output io.Writer
}
Config holds the configuration for a new project that can be created from a *kickoff.Skeleton.
type Destination ¶
type Destination struct {
// Base is the base dir of the project.
Base string
// Path is the path relative to the base dir.
Path string
}
Destination describes the destination a project file should be written to.
func (Destination) AbsPath ¶
func (d Destination) AbsPath() string
AbsPath returns the absolute file path of the destination.
func (Destination) Exists ¶
func (d Destination) Exists() bool
Exists returns true if the destination already exists.
func (Destination) RelPath ¶
func (d Destination) RelPath() string
RelPath returns the path relative to the project root.
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project is the type responsible for project creation.
Click to show internal directories.
Click to hide internal directories.