private static void CopyFolder(string sourcePath, string destinationPath)
{
Directory.CreateDirectory(destinationPath);
foreach (var filePath in Directory.GetFiles(sourcePath))
{
//better to not just copy the old thumbnail, as the on in the library may well need to look different
if (Path.GetFileNameWithoutExtension(filePath).ToLowerInvariant() == "thumbnail")
continue;
if (Path.GetFileNameWithoutExtension(filePath).StartsWith(".")) //.guidsForInstaller.xml
continue;
var ext = Path.GetExtension(filePath).ToLowerInvariant();
if (new String[] {".jade", ".less"}.Any(ex => ex == ext))
continue;
RobustFile.Copy(filePath, Path.Combine(destinationPath, Path.GetFileName(filePath)));
}
foreach (var dirPath in Directory.GetDirectories(sourcePath))
{
//any files found under "template" will not be copied. At the moment (Aug 2015), this is only
//thumbnail svgs, but we could move readme's and such in there
if (Path.GetFileName(dirPath).ToLowerInvariant() != "template")
{
CopyFolder(dirPath, Path.Combine(destinationPath, Path.GetFileName(dirPath)));
}
}
}