@@ -8,7 +8,7 @@ type InitCommand() =
88
99 let dir = Path.GetDirectoryName( typeof< InitCommand>. Assembly.Location)
1010
11- // get template locations for in-package and in-repo and decide which to use later
11+ // get template locations for in-package and in-repo files and decide which to use later
1212 let inPackageLocations = Common.InPackageLocations( Path.Combine( dir, " .." , " .." , " .." ))
1313 let inRepoLocations = Common.InRepoLocations( Path.Combine( dir, " .." , " .." , " .." , " .." , " .." ))
1414
@@ -29,6 +29,7 @@ type InitCommand() =
2929 |> List.iter ensureDirectory
3030
3131 if inPackageLocations.Exist() then
32+ // if the in-package locations exist, this means fsdocs is run from the nuget package.
3233 ensureOutputDirs ()
3334
3435 try
@@ -37,18 +38,25 @@ type InitCommand() =
3738 ( inPackageLocations.template_ tex, initLocations.template_ tex)
3839 ( inPackageLocations.dockerfile, initLocations.dockerfile)
3940 ( inPackageLocations.nuget_ config, initLocations.nuget_ config)
41+ // these files must be renamed, because files prefixed with a dot are otherwise ignored by fsdocs. We want this in the source repo, but not in the output of this command.
4042 ( inPackageLocations.logo_ template, Path.GetFullPath( Path.Combine( initLocations.docs_ img, " logo.png" )))
4143 ( inPackageLocations.index_ md_ template, Path.GetFullPath( Path.Combine( initLocations.docs, " index.md" )))
4244 ( inPackageLocations.literate_ sample_ template,
4345 Path.GetFullPath( Path.Combine( initLocations.docs, " literate_sample.fsx" ))) ]
4446 |> List.iter ( fun ( src , dst ) -> File.Copy( src, dst, true ))
4547
48+ printfn " "
49+ printfn " a basic fsdocs scaffold has been created in %s ." this.output
50+ printfn " "
51+ printfn " check it out by running 'dotnet fsdocs watch' !"
52+
4653 0
47- with e as exn ->
54+ with _ as exn ->
4855 printfn " Error: %s " exn.Message
4956 1
5057
5158 elif inRepoLocations.Exist() then
59+ // if the in-repo locations exist, this means fsdocs is run from inside the FSharp.Formatting repo itself.
5260 ensureOutputDirs ()
5361
5462 try
@@ -57,14 +65,20 @@ type InitCommand() =
5765 ( inRepoLocations.template_ tex, initLocations.template_ tex)
5866 ( inRepoLocations.dockerfile, initLocations.dockerfile)
5967 ( inRepoLocations.nuget_ config, initLocations.nuget_ config)
68+ // these files must be renamed, because files prefixed with a dot are otherwise ignored by fsdocs. We want this in the source repo, but not in the output of this command.
6069 ( inRepoLocations.logo_ template, Path.GetFullPath( Path.Combine( initLocations.docs_ img, " logo.png" )))
6170 ( inRepoLocations.index_ md_ template, Path.GetFullPath( Path.Combine( initLocations.docs, " index.md" )))
6271 ( inRepoLocations.literate_ sample_ template,
6372 Path.GetFullPath( Path.Combine( initLocations.docs, " literate_sample.fsx" ))) ]
6473 |> List.iter ( fun ( src , dst ) -> File.Copy( src, dst, true ))
6574
75+ printfn " "
76+ printfn " a basic fsdocs scaffold has been created in %s ." this.output
77+ printfn " "
78+ printfn " check it out by running 'dotnet fsdocs watch' !"
79+
6680 0
67- with e as exn ->
81+ with _ as exn ->
6882 printfn " Error: %s " exn.Message
6983 1
7084 else
0 commit comments