import * as fse from 'fs-extra' ; import { Progress } from 'vscode' ; import { AzureWizardExecuteStep , callWithTelemetryAndErrorHandling , IActionContext } from 'vscode-azureextensionui' ; import { localize } from '../../../localize' ; import { gitUtils } from '../../../utils/gitUtils' ; import { IProjectWizardContext } from '../IProjectWizardContext' ; export abstract class ProjectCreateStepBase extends AzureWizardExecuteStep < IProjectWizardContext > { public priority : number = 10 ; public abstract executeCore ( context , progress ) ; public async execute ( context , progress ) { context . telemetry . properties . projectLanguage = context . language ; context . telemetry . properties . projectRuntime = context . version ; context . telemetry . properties . openBehavior = context . openBehavior ; progress . report ( { message : localize ( 'creating' , 'Creating new project...' ) } ) ; await fse . ensureDir ( context . projectPath ) ; await this . executeCore ( context , progress ) ; if ( await gitUtils . isGitInstalled ( context . workspacePath ) && ! await gitUtils . isInsideRepo ( context . workspacePath ) ) { await gitUtils . gitInit ( context . workspacePath ) ; } await callWithTelemetryAndErrorHandling ( 'azureFunctions.createNewProjectStarted' , ( startedContext ) => { Object . assign ( startedContext , context ) ; } ) ; } public shouldExecute ( _context ) { return true ; } }