@@ -58,9 +58,10 @@ module Common =
58
58
type InRepoLocations ( relAssemblyPath ) =
59
59
60
60
// relAssemblyPath : relative path from assemly to repo root path
61
+ member _.RelAssemblyPath = relAssemblyPath
61
62
62
63
// default folder locations relative to the assembly path
63
- member _ .docs = Path.Combine( relAssemblyPath , " docs" ) |> Path.GetFullPath
64
+ member this .docs = Path.Combine( this.RelAssemblyPath , " docs" ) |> Path.GetFullPath
64
65
member this.docs_content = Path.Combine( this.docs, " content" ) |> Path.GetFullPath
65
66
member this.docs_content_image = Path.Combine( this.docs_ content, " img" ) |> Path.GetFullPath
66
67
@@ -69,6 +70,20 @@ module Common =
69
70
member this.template_ipynb = Path.Combine( this.docs, " _template.ipynb" ) |> Path.GetFullPath
70
71
member this.template_tex = Path.Combine( this.docs, " _template.tex" ) |> Path.GetFullPath
71
72
73
+ /// <summary>
74
+ /// returns true if all special files and folders of this location exist.
75
+ /// </summary>
76
+ member this.Exist () =
77
+ try
78
+ Directory.Exists( this.docs)
79
+ && Directory.Exists( this.docs_ content)
80
+ && Directory.Exists( this.docs_ content_ image)
81
+ && File.Exists( this.template_ html)
82
+ && File.Exists( this.template_ ipynb)
83
+ && File.Exists( this.template_ tex)
84
+ with _ ->
85
+ false
86
+
72
87
/// <summary>
73
88
/// a set of default locations in the nuget package created for fsdocs-tool.
74
89
/// these files are to be used in 2 scenarios assuming the tool is invoked via cli:
@@ -82,17 +97,33 @@ module Common =
82
97
type InPackageLocations ( relAssemblyPath ) =
83
98
84
99
// relAssemblyPath : relative path from assemly to package root path
100
+ member _.RelAssemblyPath = relAssemblyPath
85
101
86
102
// From .nuget\packages\fsdocs-tool\7.1.7\tools\net6.0\any
87
103
// to .nuget\packages\fsdocs-tool\7.1.7\*
88
104
89
105
// default folder locations relative to the assembly path
90
- member _ .templates = Path.Combine( relAssemblyPath , " templates" ) |> Path.GetFullPath
91
- member _ .extras = Path.Combine( relAssemblyPath , " extras" ) |> Path.GetFullPath
106
+ member this .templates = Path.Combine( this.RelAssemblyPath , " templates" ) |> Path.GetFullPath
107
+ member this .extras = Path.Combine( this.RelAssemblyPath , " extras" ) |> Path.GetFullPath
92
108
member this.extras_content = Path.Combine( this.extras, " content" ) |> Path.GetFullPath
93
109
member this.extras_content_img = Path.Combine( this.extras_ content, " img" ) |> Path.GetFullPath
94
110
95
111
// specific files in this folder structure that might need special treatment instead of just copy pasting
96
112
member this.template_html = Path.Combine( this.templates, " _template.html" ) |> Path.GetFullPath
97
113
member this.template_ipynb = Path.Combine( this.templates, " _template.ipynb" ) |> Path.GetFullPath
98
114
member this.template_tex = Path.Combine( this.templates, " _template.tex" ) |> Path.GetFullPath
115
+
116
+ /// <summary>
117
+ /// returns true if all special files and folders of this location exist.
118
+ /// </summary>
119
+ member this.Exist () =
120
+ try
121
+ Directory.Exists( this.templates)
122
+ && Directory.Exists( this.extras)
123
+ && Directory.Exists( this.extras_ content)
124
+ && Directory.Exists( this.extras_ content_ img)
125
+ && File.Exists( this.template_ html)
126
+ && File.Exists( this.template_ ipynb)
127
+ && File.Exists( this.template_ tex)
128
+ with _ ->
129
+ false
0 commit comments