projector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create added in v0.2.0

func Create(cfg CreateConfig) error

func Generate

func Generate(config *Config, provider provider) error

Generate traverses template manifest passed inside config and executes listed steps with config passed as context.

Types

type Config

type Config struct {
	WorkingDirectory string
	ProjectAuthor    string
	ProjectName      string
	ProjectPackage   string
	Manifest         *manifest.Manifest
	OptionalSteps    []string
	ManifestPath     string
}

Config contains all information required to generate project.

type CreateConfig added in v0.2.0

type CreateConfig struct {
	Config          *Config
	Provider        provider
	IncludeAllSteps bool
	PathToManifest  string
}

type Generator

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

Generator couples generation task and file provider into unite context to create project.

func NewGenerator

func NewGenerator(config *Config, provider provider) *Generator

func (*Generator) ExtractTemplateFrom

func (g *Generator) ExtractTemplateFrom(filename string) (*template.Template, error)

ExtractTemplateFrom reads plain text from specified file and tries to parse it as text/template syntax.

func (*Generator) Generate

func (g *Generator) Generate() error

Generate traverses steps in project template manifest and performs actions defined inside each of them.

func (*Generator) ProcessFiles

func (g *Generator) ProcessFiles(files []manifest.File) error

func (*Generator) RenderOutputPath

func (g *Generator) RenderOutputPath(f manifest.File) (string, error)

RenderOutputPath renders output path for passed file from raw output path template.

func (*Generator) RunShell

func (g *Generator) RunShell(rawSh string) error

RunShell renders passed raw shell script template into actual shell script and then executes it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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