Commit 11c8a8c 1 parent ad4bed6 commit 11c8a8c Copy full SHA for 11c8a8c
File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,13 @@ private void HandleFileSystemChange()
65
65
var templateDirs = new List < string > ( ) ;
66
66
67
67
foreach ( var d in runtimeDirs )
68
- {
69
- templateDirs . AddRange ( Directory . GetDirectories ( Path . Combine ( d , "Templates" ) ) ) ;
68
+ {
69
+ string templatesDirectory = Path . Combine ( d , "Templates" ) ;
70
+ if ( Directory . Exists ( templatesDirectory ) )
71
+ {
72
+ templateDirs . AddRange ( Directory . GetDirectories ( templatesDirectory ) ) ;
73
+ }
74
+
70
75
}
71
76
72
77
IEnumerable < FunctionTemplate > templates = templateDirs . Select ( GetFunctionTemplate ) . ToList ( ) ;
@@ -128,9 +133,9 @@ public IEnumerable<FunctionTemplate> GetTemplates(string runtime)
128
133
{
129
134
try
130
135
{
131
- return _templates . Any ( t => t . Runtime == runtime )
132
- ? _templates . Where ( t => t . Runtime == runtime )
133
- : _templates . Where ( t => t . Runtime == "default" ) ;
136
+ return _templates . Any ( t => t . Runtime . ToLowerInvariant ( ) == runtime . ToLowerInvariant ( ) )
137
+ ? _templates . Where ( t => t . Runtime . ToLowerInvariant ( ) == runtime . ToLowerInvariant ( ) )
138
+ : _templates . Where ( t => t . Runtime . ToLowerInvariant ( ) == "default" ) ;
134
139
}
135
140
finally
136
141
{
You can’t perform that action at this time.
0 commit comments