@@ -82,7 +82,7 @@ class InstallOptions:
8282 mrdocs_run_tests : bool = True
8383
8484 # Third-party dependencies
85- third_party_src_dir : str = "<mrdocs-src-dir>/build /third-party"
85+ third_party_src_dir : str = "<mrdocs-src-dir>/.. /third-party"
8686
8787 # Duktape
8888 duktape_src_dir : str = "<third-party-src-dir>/duktape"
@@ -743,7 +743,7 @@ def setup_mrdocs_src_dir(self):
743743 f"Source directory '{ self .options .mrdocs_src_dir } ' does not exist. Create and clone MrDocs there?" ,
744744 True ):
745745 print ("Installation aborted by user." )
746- exit ( 1 )
746+ return
747747 self .prompt_option ("mrdocs_branch" )
748748 self .prompt_option ("mrdocs_repo" )
749749 self .clone_repo (self .options .mrdocs_repo , self .options .mrdocs_src_dir , branch = self .options .mrdocs_branch )
@@ -776,6 +776,14 @@ def prompt_dependency_path_option(self, name):
776776 value = getattr (self .options , name )
777777 value = os .path .abspath (value )
778778 setattr (self .options , name , value )
779+ while self .is_inside_mrdocs_dir (value ):
780+ print (f"Error: { name } '{ value } ' cannot be inside mrdocs_src_dir '{ self .options .mrdocs_src_dir } '." )
781+ if not self .prompt_boolean (f"Would you like to specify a different { name } directory." ):
782+ print ("Installation aborted by user." )
783+ return
784+ value = self .reprompt_option (name )
785+ setattr (self .options , name , value )
786+
779787 if not os .path .exists (value ):
780788 if not self .prompt_boolean (f"'{ value } ' does not exist. Create it?" , True ):
781789 raise FileNotFoundError (f"'{ value } ' does not exist and user chose not to create it." )
@@ -1272,14 +1280,14 @@ def create_cmake_presets(self):
12721280 for key , value in new_preset ["cacheVariables" ].items ():
12731281 if not isinstance (value , str ):
12741282 continue
1275- # Replace mrdocs-src-dir with ${sourceDir}
1276- if self .options .mrdocs_src_dir and value .startswith (self .options .mrdocs_src_dir ):
1277- new_value = "${sourceDir}" + value [len (self .options .mrdocs_src_dir ):]
1278- new_preset ["cacheVariables" ][key ] = new_value
12791283 # Replace mrdocs-src-dir parent with ${sourceParentDir}
1280- elif mrdocs_src_dir_parent and value .startswith (mrdocs_src_dir_parent ):
1284+ if mrdocs_src_dir_parent and value .startswith (mrdocs_src_dir_parent ):
12811285 new_value = "${sourceParentDir}" + value [len (mrdocs_src_dir_parent ):]
12821286 new_preset ["cacheVariables" ][key ] = new_value
1287+ # Replace mrdocs-src-dir with ${sourceDir}
1288+ elif self .options .mrdocs_src_dir and value .startswith (self .options .mrdocs_src_dir ):
1289+ new_value = "${sourceDir}" + value [len (self .options .mrdocs_src_dir ):]
1290+ new_preset ["cacheVariables" ][key ] = new_value
12831291 # Replace $HOME with $env{HOME}
12841292 elif home_dir and value .startswith (home_dir ):
12851293 new_value = "$env{HOME}" + value [len (home_dir ):]
@@ -1350,8 +1358,6 @@ def install_mrdocs(self):
13501358 if self .options .mrdocs_build_dir and self .prompt_option ("mrdocs_run_tests" ):
13511359 # Look for ctest path relative to the cmake path
13521360 ctest_path = os .path .join (os .path .dirname (self .options .cmake_path ), "ctest" )
1353- if self .is_windows ():
1354- ctest_path += ".exe"
13551361 if not os .path .exists (ctest_path ):
13561362 raise FileNotFoundError (
13571363 f"ctest executable not found at { ctest_path } . Please ensure CMake is installed correctly." )
0 commit comments