init

package
v0.17.15 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package init provides functionality for initializing Stackit in a Git repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, repoRoot string, opts Options, handler Handler) error

Action performs the initialization of Stackit in a repository

func FindCommonlyNamedTrunk

func FindCommonlyNamedTrunk(branchNames []string) string

FindCommonlyNamedTrunk checks for common trunk branch names Returns the branch name if exactly one is found, empty string otherwise

func InferTrunk

func InferTrunk(ctx context.Context, runner git.Runner, branchNames []string) string

InferTrunk attempts to infer the trunk branch name

Types

type Handler

type Handler interface {
	// SelectTrunk prompts the user to select the trunk branch
	SelectTrunk(ctx context.Context, branchNames []string, inferredTrunk string) (string, error)

	// OnSuccess is called when initialization finishes
	OnSuccess(trunkName string, wasInitialized bool, isReset bool)
}

Handler abstracts interaction for the init action

type Options

type Options struct {
	Trunk string
	Reset bool
}

Options contains options for the init action

Jump to

Keyboard shortcuts

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