src/Deployer/AbstractDeployer.php
final protected function safeDelete(Server $server, array $absolutePaths): void
    {
        $deployDir = $server->get(Property::deploy_dir);
        $pathsToDelete = [];
        foreach ($absolutePaths as $path) {
            if (Str::startsWith($path, $deployDir)) {
                $pathsToDelete[] = $path;
            } else {
                $this->log(sprintf('Skipping the unsafe deletion of "%s" because it\'s not relative to the project directory.', $path));
            }
        }

        if (empty($pathsToDelete)) {
            $this->log('There are no paths to delete.');
        }

        $this->runOnServer(sprintf('rm -rf %s', implode(' ', $pathsToDelete)), $server);
    }
final protected function safeDelete(Server $server, array $absolutePaths): void
    {
        $deployDir = $server->get(Property::deploy_dir);
        $pathsToDelete = [];
        foreach ($absolutePaths as $path) {
            if (Str::startsWith($path, $deployDir)) {
                $pathsToDelete[] = $path;
            } else {
                $this->log(sprintf('Skipping the unsafe deletion of "%s" because it\'s not relative to the project directory.', $path));
            }
        }

        if (empty($pathsToDelete)) {
            $this->log('There are no paths to delete.');
        }

        $this->runOnServer(sprintf('rm -rf %s', implode(' ', $pathsToDelete)), $server);
    }
final protected function safeDelete ( Server $ server , array $ absolutePaths ) : void { $ deployDir = $ server -> get ( Property :: deploy_dir ) ; $ pathsToDelete = [ ] ; foreach ( $ absolutePaths as $ path ) { if ( Str :: startsWith ( $ path , $ deployDir ) ) { $ pathsToDelete [ ] = $ path ; } else { $ this -> log ( sprintf ( 'Skipping the unsafe deletion of "%s" because it\'s not relative to the project directory.' , $ path ) ) ; } } if ( empty ( $ pathsToDelete ) ) { $ this -> log ( 'There are no paths to delete.' ) ; } $ this -> runOnServer ( sprintf ( 'rm -rf %s' , implode ( ' ' , $ pathsToDelete ) ) , $ server ) ; }
related to removing the wrong file or directory on the server.
related to removing the wrong file or directory on the server .