@@ -180,7 +180,8 @@ namespace runcpp2
180180 return false ;
181181 }
182182
183- std::string processScriptPathStr = ProcessPath (scriptPath.string ());
183+ ghc::filesystem::path cleanScriptPath = scriptPath.lexically_normal ();
184+ std::string processScriptPathStr = ProcessPath (cleanScriptPath.string ());
184185
185186 if (Mappings.count (processScriptPathStr) > 0 )
186187 return true ;
@@ -204,7 +205,7 @@ namespace runcpp2
204205
205206 if (counter == MAX_TRIES)
206207 {
207- ssLOG_ERROR (" Failed to get unique hash for " << scriptPath .string () <<
208+ ssLOG_ERROR (" Failed to get unique hash for " << cleanScriptPath .string () <<
208209 " after " << MAX_TRIES << " attempts" );
209210 return false ;
210211 }
@@ -229,7 +230,7 @@ namespace runcpp2
229230 return false ;
230231 }
231232
232- ssLOG_INFO (" Build path " << scriptBuildPath << " for " << scriptPath );
233+ ssLOG_INFO (" Build path " << scriptBuildPath << " for " << cleanScriptPath );
233234 Mappings[processScriptPathStr] = scriptBuildPathStr;
234235 ReverseMappings[scriptBuildPathStr] = processScriptPathStr;
235236 return true ;
@@ -246,7 +247,8 @@ namespace runcpp2
246247 return false ;
247248 }
248249
249- std::string processScriptPathStr = ProcessPath (scriptPath.string ());
250+ ghc::filesystem::path cleanScriptPath = scriptPath.lexically_normal ();
251+ std::string processScriptPathStr = ProcessPath (cleanScriptPath.string ());
250252 if (Mappings.count (processScriptPathStr) == 0 )
251253 return true ;
252254
@@ -267,7 +269,8 @@ namespace runcpp2
267269 return false ;
268270 }
269271
270- return Mappings.count (ProcessPath (scriptPath.string ()));
272+ ghc::filesystem::path cleanScriptPath = scriptPath.lexically_normal ();
273+ return Mappings.count (ProcessPath (cleanScriptPath.string ()));
271274 }
272275
273276 bool BuildsManager::GetBuildMapping (const ghc::filesystem::path& scriptPath,
@@ -282,14 +285,16 @@ namespace runcpp2
282285 return false ;
283286 }
284287
288+ ghc::filesystem::path cleanScriptPath = scriptPath.lexically_normal ();
289+
285290 // If it doesn't exist, create the mapping
286- if (!Mappings.count (ProcessPath (scriptPath .string ())))
291+ if (!Mappings.count (ProcessPath (cleanScriptPath .string ())))
287292 {
288- if (!CreateBuildMapping (scriptPath ))
293+ if (!CreateBuildMapping (cleanScriptPath ))
289294 return false ;
290295 }
291296
292- outPath = BuildDirectory.string () + " /" + Mappings.at (ProcessPath (scriptPath .string ()));
297+ outPath = BuildDirectory.string () + " /" + Mappings.at (ProcessPath (cleanScriptPath .string ()));
293298 return true ;
294299 }
295300
0 commit comments