Documentation ¶
Overview ¶
Package repository provides handling of files in the user's code repository.
Index ¶
- Constants
- Variables
- func PromptPort(console input.Console, ctx context.Context, name string, svc appdetect.Project) (int, error)
- func ServiceFromDetect(root string, svcName string, prj appdetect.Project) (project.ServiceConfig, error)
- type EntryKind
- type Initializer
- func (i *Initializer) InitFromApp(ctx context.Context, azdCtx *azdcontext.AzdContext, ...) error
- func (i *Initializer) Initialize(ctx context.Context, azdCtx *azdcontext.AzdContext, ...) error
- func (i *Initializer) InitializeMinimal(ctx context.Context, azdCtx *azdcontext.AzdContext) error
- func (i *Initializer) PromptIfNonEmpty(ctx context.Context, azdCtx *azdcontext.AzdContext) error
Constants ¶
const InitGenTemplateId = "azd-init"
Variables ¶
var LanguageMap = map[appdetect.Language]project.ServiceLanguageKind{ appdetect.DotNet: project.ServiceLanguageDotNet, appdetect.Java: project.ServiceLanguageJava, appdetect.JavaScript: project.ServiceLanguageJavaScript, appdetect.TypeScript: project.ServiceLanguageTypeScript, appdetect.Python: project.ServiceLanguagePython, }
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 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.