File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,24 @@ private function getDecisions()
128128 */
129129 private function removeFromDir ($ dir , array $ excludeToolNames = [])
130130 {
131+ // Get the tools managed by tooly
132+ $ tools = $ this ->configuration ->getTools ();
133+
131134 foreach (scandir ($ dir ) as $ entry ) {
132135 $ path = $ dir . DIRECTORY_SEPARATOR . $ entry ;
133136
134137 if (false === strpos ($ path , '.phar ' )) {
135138 continue ;
136139 }
137140
141+ /* @var $tool Tool */
142+ foreach ($ tools as $ tool ) {
143+ // Check if the binary is a managed one by tooly, if not - don't remove it
144+ if (basename ($ tool ->getFilename ()) !== basename ($ path )) {
145+ continue 2 ;
146+ }
147+ }
148+
138149 if (true === in_array (basename ($ entry , '.phar ' ), $ excludeToolNames )) {
139150 continue ;
140151 }
You can’t perform that action at this time.
0 commit comments