public static void CopyPackages([NotNull] Instance instance, [NotNull] IEnumerable<Product> modules)
{
Assert.ArgumentNotNull(instance, "instance");
Assert.ArgumentNotNull(modules, "modules");
string packages = FileSystem.FileSystem.Local.Directory.Ensure(instance.PackagesFolderPath);
foreach (Product product in modules)
{
string targetFilePath = Path.Combine(packages, Path.GetFileName(product.PackagePath).EmptyToNull().IsNotNull());
FileSystem.FileSystem.Local.Directory.DeleteIfExists(targetFilePath);
FileSystem.FileSystem.Local.File.Copy(product.PackagePath, targetFilePath);
}
}