Skip to content

Commit

Permalink
Check if folder is writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Lösken committed Apr 12, 2021
1 parent fb920a7 commit 7f80f49
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Actions/MoveEntriesToCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public function run($items, $values)

/** @var \Illuminate\Support\Collection $items */
$items->each(function (Entry $item) use ($collection, $targetDir) {
ray($item->path(), $targetDir . '/' . pathinfo($item->path(), PATHINFO_BASENAME));
File::move(
$item->path(),
$targetDir . '/' . pathinfo($item->path(), PATHINFO_BASENAME)
);
if (File::isDirectory($targetDir) && File::isWritable($targetDir)) {
File::move($item->path(), $targetDir . '/' . pathinfo($item->path(), PATHINFO_BASENAME));
}
});
}

Expand Down

0 comments on commit 7f80f49

Please sign in to comment.