Skip to content

Commit

Permalink
Merge pull request #3 from XTAIN/fix-duplicate-directories
Browse files Browse the repository at this point in the history
Fix bug that creates duplicate folders with same name
  • Loading branch information
masbug authored Dec 14, 2020
2 parents 041b20c + c41559d commit ae60d8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/GoogleDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,20 @@ public function deleteDir($dirname)
*/
public function createDir($dirname, Config $config, $internalCall = false)
{
try {
$meta = $this->getMetadata($dirname);
} catch (FileNotFoundException $e) {
$meta = false;
}

if ($meta !== false) {
return [
'path' => $meta['path'],
'filename' => $meta['filename'],
'extension' => $meta['extension']
];
}

list($pdir, $name) = $this->splitPath($dirname, false);
if($this->useDisplayPaths) {
if($pdir !== $this->root) {
Expand Down

0 comments on commit ae60d8d

Please sign in to comment.