protected function copyFilesToDefaultPath($source)
    {
        $target = $this->defaultPath;
        if (!$target || $target == $source) {
            return $this;
        }

        if (is_file($source)) {
            //copy file
            copy($source, $target);
            return $this;
        }

        $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
        $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);

        $this->cleanUpDir($target);

        /** @var \SplFileInfo $file */
        foreach ($ri as $file) {
            if ('.git' . DIRECTORY_SEPARATOR == substr($ri->getSubPathName(), 0, 5)
                || '.git' == $ri->getSubPathName()
            ) {
                //skip .git directory
                continue;
            }
            $targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
            if ($file->isDir()) {
                $this->filesystem->ensureDirectoryExists($targetPath);
            } else {
                copy($file->getPathname(), $targetPath);
            }
        }
        return $this;
    }