Repository navigation
fix(new): do not hand the Composer flags to rm and rd, so --force works on Linux - #13
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
pollora new <name> --forcefailed on Linux (and in WSL) when the directory already existed, withrm: unrecognized option '--no-ansi'and the message "There was a problem installing Pollora!".RunsCommands::runCommands()adds--no-ansi(when the output is not decorated) and--quiet(with-q) to every command, because they are Composer flags. It already leaveschmod,gitandddevalone, but not therm -rf "<dir>"(orrd /s /q "<dir>"on Windows) that--forceruns beforecomposer create-project. Thermof macOS reads the flag as one more file name, which-fignores, so it worked there; GNUrmtakes options anywhere in the line and refuses the one it does not know.rmandrdnow joinchmod,gitandddevin the commands that do not get the flags.Tests
RunsCommandsFlagsTestreads back the command line thatrunCommands()builds: no flag onrmorrd(with or without--quiet),--no-ansiand--quietstill on the other commands,chmod,gitandddevstill without. Without the change the tworm/rdtests fail (on macOS too, since the command line is checked, not the effect); with it the file passes, also in aphp:8.4-cli(Linux) container. The 61 tests pass; Pint, PHPStan, Rector (--dry-run) andtests/Arch.phpare clean.Found while adding coverage tests for the package (a test of
--force, which passed on macOS and failed on Linux in the CI).