@@ -87,6 +87,11 @@ def _vcpkg_executable_path(self) -> Path:
8787 return self .vcpkg_root / "vcpkg.exe"
8888 return self .vcpkg_root / "vcpkg"
8989
90+ def _command_path (self , path : Path ) -> str :
91+ if sys_platform == "win32" :
92+ return str (path ).replace ("/" , "\\ " )
93+ return f"./{ path } "
94+
9095 def _delete_dir_command (self , path : Path ) -> str :
9196 if sys_platform == "win32" :
9297 return f'rmdir /s /q "{ path } "'
@@ -109,7 +114,7 @@ def _clone_checkout_bootstrap_commands(self) -> list[str]:
109114 if ref is not None :
110115 commands .append (f"git -C { self .vcpkg_root } checkout { ref } " )
111116
112- commands .append (f"./ { self ._bootstrap_script_path ()} " )
117+ commands .append (self . _command_path ( self ._bootstrap_script_path ()) )
113118 return commands
114119
115120 def generate (self , config ):
@@ -134,11 +139,11 @@ def generate(self, config):
134139 else :
135140 vcpkg_executable = self ._vcpkg_executable_path ()
136141 if not vcpkg_executable .exists ():
137- commands .append (f"./ { bootstrap_script } " )
142+ commands .append (self . _command_path ( bootstrap_script ) )
138143 elif not self ._is_vcpkg_working ():
139144 commands .append (self ._delete_dir_command (vcpkg_root ))
140145 commands .extend (self ._clone_checkout_bootstrap_commands ())
141146
142- commands .append (f"./ { self .vcpkg_root / 'vcpkg' } install --triplet { self .vcpkg_triplet } " )
147+ commands .append (f"{ self ._command_path ( self . _vcpkg_executable_path ()) } install --triplet { self .vcpkg_triplet } " )
143148
144149 return commands
0 commit comments