pkg

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamName = "name"
	ParamPos  = "pos"

	PosStart = "start"
	PosEnd   = "end"
)

Variables

View Source
var (
	PosList = []string{PosStart, PosEnd}
)

Functions

func ResolveSourcePath added in v0.2.0

func ResolveSourcePath(ctx context.Context, source config.Source, workdir string, cloner git.Cloner) (string, error)

ResolveSourcePath given a source, resolves it by cloning the repository (if applicable) and returning the directory of the source.

func Run

func Run(ctx context.Context, cloner git.Cloner, runOpts *RunOpts) error

func RunHook added in v0.2.1

func RunHook(ctx context.Context, hook string) error

func RunTarget added in v0.2.1

func RunTarget(ctx context.Context, target config.Target, cloner git.Cloner, dryRun, confirm bool) (bool, error)

Types

type Block

type Block struct {
	Name  string
	Lines []string
}

func (*Block) Compare

func (b *Block) Compare(lines []string) string

func (*Block) Render

func (b *Block) Render() string

func (*Block) SetLines

func (b *Block) SetLines(lines []string)

type Blocks

type Blocks []*Block

func (*Blocks) Get

func (b *Blocks) Get(name string) *Block

func (*Blocks) Render

func (b *Blocks) Render() string

type RunOpts

type RunOpts struct {
	DryRun       bool
	Confirm      bool
	Publish      bool
	AllowDirty   bool
	Force        bool
	StashChanges bool
	BaseBranch   string
}

func NewRunOpts

func NewRunOpts(
	dryRun, confirm, publish, allowDirty, force, stashChanges bool,
	baseBranch string,
) *RunOpts

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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