Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #55 from KasperFranz/patch-1
Browse files Browse the repository at this point in the history
Lets keep peoples git repos clean after a update
  • Loading branch information
shaggyz committed Feb 10, 2016
2 parents bf9550c + df58015 commit a79c4f7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Xinax/LaravelGettext/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function createPOFile($path, $locale, $domain, $write = true)
*/
protected function createDirectory($path)
{
if (!mkdir($path)) {
if (!file_exists($path) && !mkdir($path)) {
throw new FileCreationException(
sprintf('Can\'t create the directory: %s', $path)
);
Expand Down Expand Up @@ -549,11 +549,15 @@ public static function clearDirectory($path)
);

foreach ($files as $fileinfo) {
$todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
$todo($fileinfo->getRealPath());
// if the file isn't a .gitignore file we should remove it.
if($fileinfo->getFilename() !== '.gitignore'){
$todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
$todo($fileinfo->getRealPath());
}
}

rmdir($path);

// since the folder now contains a .gitignore we can't remove it
//rmdir($path);
return true;
}

Expand Down

0 comments on commit a79c4f7

Please sign in to comment.