@@ -58,9 +58,10 @@ module Common =
5858type  InRepoLocations ( relAssemblyPath )  = 
5959
6060        // relAssemblyPath : relative path from assemly to repo root path 
61+         member  _.RelAssemblyPath  =  relAssemblyPath
6162
6263        // 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
6465        member  this.docs_content  =  Path.Combine( this.docs,  " content" )  |>  Path.GetFullPath
6566        member  this.docs_content_image  =  Path.Combine( this.docs_ content,  " img" )  |>  Path.GetFullPath
6667
@@ -69,6 +70,20 @@ module Common =
6970        member  this.template_ipynb  =  Path.Combine( this.docs,  " _template.ipynb" )  |>  Path.GetFullPath
7071        member  this.template_tex  =  Path.Combine( this.docs,  " _template.tex" )  |>  Path.GetFullPath
7172
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+ 
7287    /// <summary> 
7388/// a set of default locations in the nuget package created for fsdocs-tool. 
7489/// these files are to be used in 2 scenarios assuming the tool is invoked via cli: 
@@ -82,17 +97,33 @@ module Common =
8297type  InPackageLocations ( relAssemblyPath )  = 
8398
8499        // relAssemblyPath : relative path from assemly to package root path 
100+         member  _.RelAssemblyPath  =  relAssemblyPath
85101
86102        //   From .nuget\packages\fsdocs-tool\7.1.7\tools\net6.0\any 
87103        //   to .nuget\packages\fsdocs-tool\7.1.7\* 
88104
89105        // 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
92108        member  this.extras_content  =  Path.Combine( this.extras,  " content" )  |>  Path.GetFullPath
93109        member  this.extras_content_img  =  Path.Combine( this.extras_ content,  " img" )  |>  Path.GetFullPath
94110
95111        // specific files in this folder structure that might need special treatment instead of just copy pasting 
96112        member  this.template_html  =  Path.Combine( this.templates,  " _template.html" )  |>  Path.GetFullPath
97113        member  this.template_ipynb  =  Path.Combine( this.templates,  " _template.ipynb" )  |>  Path.GetFullPath
98114        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