Skip to content

Fix space in paths#4553

Merged
TomasVotruba merged 2 commits intomainfrom
tv-allow-space-in-paths
Jul 20, 2023
Merged

Fix space in paths#4553
TomasVotruba merged 2 commits intomainfrom
tv-allow-space-in-paths

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jul 20, 2023

@TomasVotruba TomasVotruba changed the title tv allow space in paths Fix space in paths Jul 20, 2023
@TomasVotruba TomasVotruba force-pushed the tv-allow-space-in-paths branch 2 times, most recently from 7332024 to 4aee2de Compare July 20, 2023 14:50
@TomasVotruba TomasVotruba force-pushed the tv-allow-space-in-paths branch from 2640269 to 32741f8 Compare July 20, 2023 14:57
Comment on lines -96 to -109
/**
* @param string[] $commandLinePaths
* @return string[]
*/
private function correctBashSpacePaths(array $commandLinePaths): array
{
// fixes bash edge-case that to merges string with space to one
foreach ($commandLinePaths as $commandLinePath) {
if (\str_contains($commandLinePath, ' ')) {
$commandLinePaths = explode(' ', $commandLinePath);
}
}

return $commandLinePaths;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually incorrectly splits any spaced path to 2 strings:

/some directory/file.php

will result into:

/some
directory/file.php

@TomasVotruba TomasVotruba merged commit bbe6ed0 into main Jul 20, 2023
@TomasVotruba TomasVotruba deleted the tv-allow-space-in-paths branch July 20, 2023 15:01
@samsonasik
Copy link
Copy Markdown
Member

@paulbalandan could you verify this on windows? Try latest rector/rector:dev-main. Thank you.

@paulbalandan
Copy link
Copy Markdown
Contributor

@samsonasik I used rector/rector dev-main ad6f93a

PS C:\Users\P\Desktop\Web Dev\CodeIgniter4> vendor/bin/rector process system
Could not open input file: C:\Users\P\Desktop\Web

@samsonasik
Copy link
Copy Markdown
Member

@paulbalandan thank you for check.

@TomasVotruba it may need to use e2e for windows.

@paulbalandan could you help create a reproducible e2e or github repo with windows running ( vendor committed ) to allow debug in there? Thank you.

@samsonasik
Copy link
Copy Markdown
Member

@TomasVotruba the issue on windows seems the root path before project path that may contains space

:\Users\P\Desktop\Web Dev\CodeIgniter4> vendor/bin/rector

@TomasVotruba
Copy link
Copy Markdown
Member Author

@samsonasik I see 👍 . I don't use Windows so I can't help much. Having a e2e test case would give us at least regression check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot process files

3 participants