Reorder code to fix absoluteFilePath on windows fixes #11312 #11346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request will reorder the operations when attempting to get the absolute file path of an asset. I have reordered the operations in this pull request so we will convert the asset path before checking if it exists. Before when you passed a windows files path to
getAbsoluteFilePath
(e.g. getAbsoluteFilePath(tests\test
)) the array that holds the assets would be storing the path with a linux like separator (e.g.test/test
). Since the separator does not match, the asset was not found. TheconvertToStandartPath
function takes care of this by changing the assetPath to use the proper separator. This function was being called after the existence check, which was too late causing the code to throw the error on line 365.@filipenevola sorry about the delay for getting the pr up on this.
Closes #11312