Skip to content

Commit 2f9de2c

Browse files
committed
add cli success messages
and comment init command code a little
1 parent 1766ced commit 2f9de2c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/fsdocs-tool/InitCommand.fs

+17-3
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)