File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
src/Cli/func/Actions/LocalActions Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -96,16 +96,6 @@ public override ICommandLineParserResult ParseArgs(string[] args)
9696 return base . ParseArgs ( args ) ;
9797 }
9898
99- public async Task InitializeTemplatesAndPrompts ( )
100- {
101- _templates = await _templatesManager . Templates ;
102- if ( IsNewPythonProgrammingModel ( ) )
103- {
104- _newTemplates = await _templatesManager . NewTemplates ;
105- _userPrompts = await _templatesManager . UserPrompts ;
106- }
107- }
108-
10999 public override async Task RunAsync ( )
110100 {
111101 // Check if the command only ran for help.
@@ -120,11 +110,17 @@ public override async Task RunAsync()
120110 return ;
121111 }
122112
123- // Ensure that the templates, new templates, and user prompts are loaded before proceeding.
124- await InitializeTemplatesAndPrompts ( ) ;
113+ // Ensure that the _templates are loaded before we proceed
114+ _templates = await _templatesManager . Templates ;
125115
126116 await UpdateLanguageAndRuntime ( ) ;
127117
118+ if ( IsNewPythonProgrammingModel ( ) ) // depends on UpdateLanguageAndRuntime to set 'Language'
119+ {
120+ _newTemplates = await _templatesManager . NewTemplates ;
121+ _userPrompts = await _templatesManager . UserPrompts ;
122+ }
123+
128124 if ( WorkerRuntimeLanguageHelper . IsDotnet ( _workerRuntime ) && ! Csx )
129125 {
130126 if ( string . IsNullOrWhiteSpace ( TemplateName ) )
You can’t perform that action at this time.
0 commit comments