Skip to content

Commit 8a0c82e

Browse files
liliankasemaishwaryabh
authored andcommitted
Fix python templates path
1 parent 8d2909a commit 8a0c82e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/Cli/func/Actions/LocalActions/CreateFunctionAction.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)