Open ashthomas92 opened 1 week ago
Glad to see Eightshift usage and contributions.
I think this method is unreliable, especially for extending Eightshift, and should be refactored entirely. I am willing to do this myself.
This isn't at all a critique of your PR, @ashtomas92, and I am very grateful to see contributions.
:
, so this check can break paths on LinuxABSPATH
to be correct? can this not be a flag?why couldn't I just do this:
file_get_contents(Helpers::joinPaths(['Blocks', 'components', 'heading', 'manifest.json']
Once again, very happy to see contributions. I am hoping a fix will get merged soon.
If the original path is captured from a known location using __DIR__
, the base path should be easy to work out without de/reconstructing it, the slash at the start can then just remain if it was already present, same for the drive indicator as per Windows.
On Windows, no paths are resolved from the manifest, leading to a InvalidManifest exception.
Description
The
Helpers::joinPaths()
method prepends the directory separator onto the generated base file path. On Windows this causes the paths not to be resolved, leading to it being unable to read any files frommanifest.json
. This fix checks to see if the base path has a disk indicator prefixing the path, and only prepends the separator when it doesn't.