@@ -69,8 +69,8 @@ protected override async Task<SyncAttempt<ITemplate>> ProcessDeleteAsync(Guid ke
69
69
var item = default ( ITemplate ) ;
70
70
71
71
if ( key != Guid . Empty )
72
- item = await FindItemAsync ( key ) ;
73
-
72
+ item = await FindItemAsync ( key ) ;
73
+
74
74
return item ?? await FindItemAsync ( alias ) ;
75
75
76
76
}
@@ -149,35 +149,25 @@ protected override async Task<SyncAttempt<ITemplate>> DeserializeCoreAsync(XElem
149
149
logger . LogDebug ( "Getting content for Template from XML" ) ;
150
150
return Attempt . Succeed ( GetContentFromConfig ( node ) ) ;
151
151
}
152
- else
153
- {
154
- logger . LogDebug ( "Loading template content from disk" ) ;
155
152
156
- var templatePath = ViewPath ( node . GetAlias ( ) ) ;
157
- if ( templatePath is not null && _viewFileSystem ? . FileExists ( templatePath ) is true )
158
- {
159
- logger . LogDebug ( "Reading {path} contents" , templatePath ) ;
160
- return Attempt . Succeed ( GetContentFromFile ( templatePath ) ) ;
161
- }
162
- else
163
- {
164
- if ( ! ViewsAreCompiled ( options ) )
165
- {
166
- // template is missing
167
- // we can't create
168
- logger . LogWarning ( "Failed to create template {path} the local file is missing" , templatePath ) ;
169
- return Attempt . Fail ( "" , new Exception ( $ "The template { templatePath } file is missing.") ) ;
170
- }
171
- else
172
- {
173
- // template is not on disk, we could use the viewEngine to find the view
174
- // if this finds the view it tells us that the view is somewhere else ?
153
+ var templatePath = ViewPath ( node . GetAlias ( ) ) ;
154
+ if ( templatePath is not null && _viewFileSystem ? . FileExists ( templatePath ) is true )
155
+ {
156
+ logger . LogDebug ( "Reading {path} contents" , templatePath ) ;
157
+ return Attempt . Succeed ( GetContentFromFile ( templatePath ) ) ;
158
+ }
175
159
176
- logger . LogDebug ( "Failed to find content, but UsingRazorViews so will create anyway, then delete the file" ) ;
177
- return Attempt . Succeed ( $ "<!-- [uSyncMarker:{ this . Id } ] template content - will be removed -->") ;
178
- }
179
- }
160
+ if ( ! ViewsAreCompiled ( options ) )
161
+ {
162
+ // template is missing and the views are not compiled , then we can't create.
163
+ logger . LogWarning ( "Failed to create template {path} the local file is missing" , templatePath ) ;
164
+ return Attempt . Fail ( "" , new Exception ( $ "The template { templatePath } file is missing.") ) ;
180
165
}
166
+ // template is not on disk, we could use the viewEngine to find the view
167
+ // if this finds the view it tells us that the view is somewhere else ?
168
+
169
+ logger . LogDebug ( "Failed to find content, but UsingRazorViews so will create anyway, then delete the file" ) ;
170
+ return Attempt . Succeed ( $ "<!-- [uSyncMarker:{ this . Id } ] template content - will be removed -->") ;
181
171
}
182
172
183
173
/// <summary>
0 commit comments