Skip to content

Commit cecd4a3

Browse files
committed
Create composer binary directory if it not exist
1 parent ca44d13 commit cecd4a3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Script/Helper/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function remove($file)
9898
* @return bool
9999
* @SuppressWarnings(PHPMD.StaticAccess)
100100
*/
101-
private function createDirectory($filename)
101+
public function createDirectory($filename)
102102
{
103103
$directory = dirname($filename);
104104

src/Script/Processor.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ public function __construct(IOInterface $io, Helper $helper, Configuration $conf
4949
*/
5050
public function cleanUp()
5151
{
52-
$this->removeFromDir(
53-
$this->configuration->getComposerBinDirectory()
54-
);
52+
$composerBinDirectory = $this->configuration->getComposerBinDirectory();
53+
54+
if (false === is_dir($composerBinDirectory)) {
55+
$this->helper->getFilesystem()->createDirectory($composerBinDirectory);
56+
}
5557

58+
$this->removeFromDir($composerBinDirectory);
5659
$this->removeFromDir(
5760
$this->configuration->getBinDirectory(),
5861
array_keys($this->configuration->getTools())

0 commit comments

Comments
 (0)