Skip to content

Commit

Permalink
Fixes #635 use mv instead of rename as that does not support cross vo…
Browse files Browse the repository at this point in the history
…lume operations
  • Loading branch information
flaviocopes committed Dec 14, 2016
1 parent 5b6452d commit b7a1cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

1. [](#bugfix)
* Fixed case where extracting a package would cause an error during rename
* Fixed [#635](https://github.com/getgrav/grav/issues/635) use mv instead of rename as that does not support cross volume operations

# v1.1.9
## 12/13/2016
Expand Down
7 changes: 3 additions & 4 deletions system/src/Grav/Common/Filesystem/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,10 @@ public static function move($source, $target)
self::create(dirname($target));

// Just rename the directory.
$success = @rename($source, $target);
exec("mv $source $target", $output, $return_val);

if (!$success) {
$error = error_get_last();
throw new \RuntimeException($error['message']);
if ($return_val !== 0) {
throw new \RuntimeException($error['message']);
}

// Make sure that the change will be detected when caching.
Expand Down

0 comments on commit b7a1cbf

Please sign in to comment.