public function buildZip($file, $basePath)
    {
        yield 'Generating zip file ' . $file;

        $zip = new \ZipArchive();
        $res = $zip->open($file, \ZipArchive::CREATE);

        if ($res === true) {
            $this->buildZipArchive($basePath, $zip, $basePath, 0);
            $zip->close();

            yield 'Generation completed file size ' . (round(filesize($file) / 1024, 2)) . 'kb';
        } else {
            throw new \RuntimeException('Could not create zip file ' . $file);
        }
    }