Skip to content

Commit f6aeb39

Browse files
committed
Remove additional dirname() to create the real directory. Fixes #10.
1 parent a114cbb commit f6aeb39

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Script/Helper/Filesystem.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function isFileAlreadyExist($filename)
4242
*/
4343
public function createFile($filename, $content)
4444
{
45-
if (false === $this->createDirectory($filename)) {
45+
if (false === $this->createDirectory(dirname($filename))) {
4646
return false;
4747
}
4848

@@ -60,7 +60,7 @@ public function createFile($filename, $content)
6060
*/
6161
public function symlinkFile($sourceFile, $file)
6262
{
63-
if (false === $this->createDirectory($file)) {
63+
if (false === $this->createDirectory(dirname($file))) {
6464
return false;
6565
}
6666

@@ -93,16 +93,14 @@ public function remove($file)
9393
}
9494

9595
/**
96-
* @param string $filename
96+
* @param string $directory
9797
*
9898
* @return bool
9999
* @SuppressWarnings(PHPMD.StaticAccess)
100100
*/
101-
public function createDirectory($filename)
101+
public function createDirectory($directory)
102102
{
103-
$directory = dirname($filename);
104-
105-
if (true === file_exists($directory)) {
103+
if (true === is_dir($directory)) {
106104
return true;
107105
}
108106

0 commit comments

Comments
 (0)