@@ -8,7 +8,7 @@ type InitCommand() =
8
8
9
9
let dir = Path.GetDirectoryName( typeof< InitCommand>. Assembly.Location)
10
10
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
12
12
let inPackageLocations = Common.InPackageLocations( Path.Combine( dir, " .." , " .." , " .." ))
13
13
let inRepoLocations = Common.InRepoLocations( Path.Combine( dir, " .." , " .." , " .." , " .." , " .." ))
14
14
@@ -29,6 +29,7 @@ type InitCommand() =
29
29
|> List.iter ensureDirectory
30
30
31
31
if inPackageLocations.Exist() then
32
+ // if the in-package locations exist, this means fsdocs is run from the nuget package.
32
33
ensureOutputDirs ()
33
34
34
35
try
@@ -37,18 +38,25 @@ type InitCommand() =
37
38
( inPackageLocations.template_ tex, initLocations.template_ tex)
38
39
( inPackageLocations.dockerfile, initLocations.dockerfile)
39
40
( 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.
40
42
( inPackageLocations.logo_ template, Path.GetFullPath( Path.Combine( initLocations.docs_ img, " logo.png" )))
41
43
( inPackageLocations.index_ md_ template, Path.GetFullPath( Path.Combine( initLocations.docs, " index.md" )))
42
44
( inPackageLocations.literate_ sample_ template,
43
45
Path.GetFullPath( Path.Combine( initLocations.docs, " literate_sample.fsx" ))) ]
44
46
|> List.iter ( fun ( src , dst ) -> File.Copy( src, dst, true ))
45
47
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
+
46
53
0
47
- with e as exn ->
54
+ with _ as exn ->
48
55
printfn " Error: %s " exn.Message
49
56
1
50
57
51
58
elif inRepoLocations.Exist() then
59
+ // if the in-repo locations exist, this means fsdocs is run from inside the FSharp.Formatting repo itself.
52
60
ensureOutputDirs ()
53
61
54
62
try
@@ -57,14 +65,20 @@ type InitCommand() =
57
65
( inRepoLocations.template_ tex, initLocations.template_ tex)
58
66
( inRepoLocations.dockerfile, initLocations.dockerfile)
59
67
( 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.
60
69
( inRepoLocations.logo_ template, Path.GetFullPath( Path.Combine( initLocations.docs_ img, " logo.png" )))
61
70
( inRepoLocations.index_ md_ template, Path.GetFullPath( Path.Combine( initLocations.docs, " index.md" )))
62
71
( inRepoLocations.literate_ sample_ template,
63
72
Path.GetFullPath( Path.Combine( initLocations.docs, " literate_sample.fsx" ))) ]
64
73
|> List.iter ( fun ( src , dst ) -> File.Copy( src, dst, true ))
65
74
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
+
66
80
0
67
- with e as exn ->
81
+ with _ as exn ->
68
82
printfn " Error: %s " exn.Message
69
83
1
70
84
else
0 commit comments