project

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(s *skeleton.Skeleton, targetDir string, options *CreateOptions) error

CreateProject creates a new project with given options from skeleton s in targetDir.

Types

type CreateOptions

type CreateOptions struct {
	DryRun    bool
	Config    config.Project
	Values    template.Values
	Gitignore string
	InitGit   bool
	License   *license.Info
}

CreateOptions provide optional configuration for the project creator. If DryRun is set to true, actions will only be logged, but nothing will be written to the project output dir.

type Creator

type Creator struct {
	Filesystem afero.Fs
	Options    *CreateOptions
}

Creator can create new projects from project skeletons.

func NewCreator

func NewCreator(options *CreateOptions) *Creator

NewCreator creates a new project creator with given options.

func (*Creator) CreateProject

func (c *Creator) CreateProject(s *skeleton.Skeleton, targetDir string) error

CreateProject creates a new project from skeleton s in targetDir.

type SkeletonFileWriter

type SkeletonFileWriter struct {
	// contains filtered or unexported fields
}

SkeletonFileWriter writes skeleton files into a target directory after rendering all templates contained in them.

func NewSkeletonFileWriter

func NewSkeletonFileWriter(fs afero.Fs) *SkeletonFileWriter

NewSkeletonFileWriter creates a new *SkeletonFileWriter which uses fs as the target filesystem for all files and directories that may be created.

func (*SkeletonFileWriter) WriteFiles

func (fw *SkeletonFileWriter) WriteFiles(files []*skeleton.File, targetDir string, values template.Values) error

WriteFiles writes files to targetDir. The provided template values are passed to template files and template filenames before rendering them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL