Skip to content

Commit f8d8514

Browse files
committed
Fix issues with installer on windows
1 parent 5329f05 commit f8d8514

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/Commands/CoilpackCommand.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,23 @@ public function installRelease($release)
220220
// Move and set permissions
221221
$this->info("Moving installation to $installPath");
222222
if ($this->option('force') || count(File::glob("{$installPath}/*", GLOB_NOSORT)) === 0) {
223-
File::moveDirectory("{$localPath}/unpacked", $installPath);
223+
File::moveDirectory("{$localPath}/unpacked", $installPath, true);
224224

225225
$permissionsMap = [
226-
'system/user/config' => 777,
227-
'system/user/cache' => 777,
228-
'system/user/templates' => 777,
229-
'system/user/language' => 777,
230-
'images' => 777,
231-
'themes/user' => 777,
226+
'system/user/config' => 0777,
227+
'system/user/cache' => 0777,
228+
'system/user/templates' => 0777,
229+
'system/user/language' => 0777,
230+
'images' => 0777,
231+
'themes/user' => 0777,
232232
];
233233

234+
// Recursively set permissions on directories
234235
foreach($permissionsMap as $path => $permission) {
235-
exec("chmod -R $permission $installPath/$path");
236+
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator("$installPath/$path"));
237+
foreach ($iterator as $item) {
238+
@chmod($item, $permission);
239+
}
236240
}
237241
}
238242
}

0 commit comments

Comments
 (0)