private function prepareInstallationDirectory($directory)
    {
        if (!$this->files->exists($directory)) {
            $this->files->makeDirectory($directory . DIRECTORY_SEPARATOR, 0755, true);

            return;
        }

        $this->files->deleteDirectory($directory, true);
        $this->checkInstallationDirectory($directory);
    }