deployer
deployer copied to clipboard
Old releases are not deleted if colors is enabled for ls command
- Deployer version: 7.1.3
- Deployment OS: macOS
I noticed that for a project the old releases were not deleted while keep_releases
was set to 3. After some debugging I finally noticed that on the server we had ls
aliased to ls --color=always
. Because of this the array_map()
in https://github.com/deployphp/deployer/blob/1bc90e84426059feb3a390283db6f2790e35d5a1/recipe/deploy/release.php#L39-L43 is producing an array with empty values:
array(32) {
[0]=>
string(4) ""
[1]=>
string(4) ""
[2]=>
string(4) ""
[3]=>
string(4) ""
[4]=>
Before array_map()
the output of $ll
looks like:
![Bildschirmfoto 2023-01-30 um 17 17 14](https://user-images.githubusercontent.com/617637/215532463-1f006a64-dfb2-4cdf-b74a-030ca09cdac9.png)
As you can see the folder name is in color.
The current fix would be to remove the alias but I'm wondering if Deployer should prevent the colors by explicitly passing --color=none
to ls
?
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.