Help us shape the future of Go! Take the 2026 Go Developer Survey

repository

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Overview

Package repository provides handling of files in the user's code repository.

Index

Constants

View Source
const InitGenTemplateId = "azd-init"

Variables

This section is empty.

Functions

func InitEnvFileValues

func InitEnvFileValues() (map[string]string, error)

Types

type EntryKind

type EntryKind string
const (
	EntryKindDetected EntryKind = "detection"
	EntryKindManual   EntryKind = "manual"
	EntryKindModified EntryKind = "modified"
)

type Initializer

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

Initializer handles the initialization of a local repository.

func NewInitializer

func NewInitializer(
	console input.Console,
	gitCli *git.Cli,
	dotnetCli *dotnet.Cli,
	features *alpha.FeatureManager,
	lazyEnvManager *lazy.Lazy[environment.Manager],
) *Initializer

func (*Initializer) InitFromApp

func (i *Initializer) InitFromApp(
	ctx context.Context,
	azdCtx *azdcontext.AzdContext,
	initializeEnv func() (*environment.Environment, error),
	initializeMinimal func() error,
	envSpecified bool) error

InitFromApp initializes the infra directory and project file from the current existing app.

func (*Initializer) Initialize

func (i *Initializer) Initialize(
	ctx context.Context,
	azdCtx *azdcontext.AzdContext,
	template *templates.Template,
	templateBranch string) error

Initializes a local repository in the project directory from a remote repository or local template directory.

A confirmation prompt is displayed for any existing files to be overwritten.

func (*Initializer) InitializeMinimal

func (i *Initializer) InitializeMinimal(ctx context.Context, azdCtx *azdcontext.AzdContext) error

Initializes a minimal azd project.

func (*Initializer) PromptIfNonEmpty

func (i *Initializer) PromptIfNonEmpty(ctx context.Context, azdCtx *azdcontext.AzdContext) error

PromptIfNonEmpty prompts the user for confirmation if the project directory to initialize in is non-empty. Returns error if an error occurred while prompting, or if the user declines confirmation.

Jump to

Keyboard shortcuts

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