@@ -1455,27 +1455,17 @@ type CoreBuildOptions(watch) =
14551455 let inPackageLocations = Common.InPackageLocations( Path.Combine( dir, " .." , " .." , " .." ))
14561456 let inRepoLocations = Common.InRepoLocations( Path.Combine( dir, " .." , " .." , " .." , " .." , " .." ))
14571457
1458- let defaultTemplateAttempt1 = inPackageLocations.template_ html
1459- // This is in-repo only
1460- let defaultTemplateAttempt2 = inRepoLocations.template_ html
1461-
14621458 let defaultTemplate =
14631459 if this.nodefaultcontent then
14641460 None
14651461 else if
1466- ( try
1467- File.Exists( defaultTemplateAttempt1)
1468- with _ ->
1469- false )
1462+ inPackageLocations.Exists()
14701463 then
1471- Some defaultTemplateAttempt1
1464+ Some inPackageLocations.template _ html
14721465 elif
1473- ( try
1474- File.Exists( defaultTemplateAttempt2)
1475- with _ ->
1476- false )
1466+ inRepoLocations.Exists()
14771467 then
1478- Some defaultTemplateAttempt2
1468+ Some inRepoLocations.template _ html
14791469 else
14801470 None
14811471
@@ -1484,32 +1474,21 @@ type CoreBuildOptions(watch) =
14841474 // The "extras" content goes in "."
14851475 // From .nuget\packages\fsdocs-tool\7.1.7\tools\net6.0\any
14861476 // to .nuget\packages\fsdocs-tool\7.1.7\extras
1487- let attempt1 = inPackageLocations.extras
1488-
1489- if
1490- ( try
1491- Directory.Exists( attempt1)
1492- with _ ->
1493- false )
1477+ if inPackageLocations.Exists()
14941478 then
1495- printfn " using extra content from %s " attempt1
1496- ( attempt1 , " ." )
1479+ printfn " using extra content from %s " inPackageLocations.extras
1480+ ( inPackageLocations.extras , " ." )
14971481 else
14981482 // This is for in-repo use only, assuming we are executing directly from
14991483 // src\fsdocs-tool\bin\Debug\net6.0\fsdocs.exe
15001484 // src\fsdocs-tool\bin\Release\net6.0\fsdocs.exe
1501- let attempt2 = inRepoLocations.docs_ content
1502-
15031485 if
1504- ( try
1505- Directory.Exists( attempt2)
1506- with _ ->
1507- false )
1486+ inRepoLocations.Exists()
15081487 then
1509- printfn " using extra content from %s " attempt2
1510- ( attempt2 , " content" )
1488+ printfn " using extra content from %s " inRepoLocations.docs _ content
1489+ ( inRepoLocations.docs _ content , " content" )
15111490 else
1512- printfn " no extra content found at %s or %s " attempt1 attempt2 ]
1491+ printfn " no extra content found at %s or %s " inPackageLocations.extras inRepoLocations.docs _ content ]
15131492
15141493 // The incremental state (as well as the files written to disk)
15151494 let mutable latestApiDocModel = None
@@ -1573,7 +1552,7 @@ type CoreBuildOptions(watch) =
15731552 printfn
15741553 " note, no template file '%s ' found, and no default template at '%s '"
15751554 templateFiles
1576- defaultTemplateAttempt1
1555+ inRepoLocations.template _ html
15771556
15781557 OutputKind.Html, None
15791558
0 commit comments