repository

package
v0.0.0-...-6cd82ae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 39 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

Functions

func PromptPort

func PromptPort(
	console input.Console,
	ctx context.Context,
	name string,
	svc appdetect.Project) (int, error)

PromptPort prompts for port selection from an appdetect project.

func ServiceFromDetect

func ServiceFromDetect(
	root string,
	svcName string,
	prj appdetect.Project) (project.ServiceConfig, error)

ServiceFromDetect creates a ServiceConfig from an appdetect project.

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)) 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.

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