File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -220,14 +220,21 @@ string GetItemUid(YamlNode item)
220
220
}
221
221
}
222
222
223
- // Now add our new items
223
+ // Now add our new items, overwriting if they already exist
224
224
foreach ( var item in items )
225
225
{
226
226
var typeKey = ToSequenceKey ( item . ItemType ) ;
227
227
SortedDictionary < string , YamlNode > typeList ;
228
228
if ( itemTypeNodes . TryGetValue ( typeKey , out typeList ) )
229
229
{
230
- typeList . Add ( item . Uid , item . ToNamespaceItem ( ) ) ;
230
+ if ( typeList . ContainsKey ( item . Uid ) )
231
+ {
232
+ // TODO: Emit a warning log / diagnostic. What is the accepted way to do that here?
233
+ // $"Documentation for {item.Uid} already exists in this folder and will be overwritten.
234
+ // It's recommended to compile docs to a new folder to avoid deleted files lingering."
235
+ }
236
+
237
+ typeList [ item . Uid ] = item . ToNamespaceItem ( ) ;
231
238
}
232
239
}
233
240
Original file line number Diff line number Diff line change @@ -180,6 +180,13 @@ let ``generate docs`` () =
180
180
Assert.True ( existsAndNotEmpty nsDoc)
181
181
Assert.True ( existsAndNotEmpty opDoc)
182
182
183
+ // Verify that we can compile repeatedly without errors despite docs already existing.
184
+ let result2 = Program.Main args
185
+ Assert.Equal( ReturnCode.SUCCESS, result2)
186
+ Assert.True ( existsAndNotEmpty toc)
187
+ Assert.True ( existsAndNotEmpty nsDoc)
188
+ Assert.True ( existsAndNotEmpty opDoc)
189
+
183
190
184
191
[<Fact>]
185
192
let ``find path relative`` () =
You can’t perform that action at this time.
0 commit comments