Trim instead of error

This commit is contained in:
Anton Medvedev 2021-09-24 14:07:48 +02:00
parent b724073157
commit 94a2e7ab6c

View File

@ -5,9 +5,9 @@ desc('Copy directories');
task('deploy:copy_dirs', function () {
if (has('previous_release')) {
foreach (get('copy_dirs') as $dir) {
if (substr($dir, -1) === '/') {
throw new \RuntimeException('Entries in config parameter "copy_dirs" must not end with "/"');
}
// Make sure all path without tailing slash.
$dir = trim($dir, '/');
if (test("[ -d {{previous_release}}/$dir ]")) {
$destinationDir = '';
if (strpos($dir, '/') !== false) {