forked from microsoft/react-native-code-push
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileUtils.cs
More file actions
23 lines (21 loc) · 842 Bytes
/
FileUtils.cs
File metadata and controls
23 lines (21 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Threading.Tasks;
using Windows.Storage;
namespace CodePush.ReactNative
{
internal class FileUtils
{
internal async static Task MergeFolders(StorageFolder source, StorageFolder target)
{
foreach (StorageFile sourceFile in await source.GetFilesAsync())
{
await sourceFile.CopyAndReplaceAsync(await target.CreateFileAsync(sourceFile.Name, CreationCollisionOption.OpenIfExists));
}
foreach (StorageFolder sourceDirectory in await source.GetFoldersAsync())
{
StorageFolder nextTargetSubDir = await target.CreateFolderAsync(sourceDirectory.Name, CreationCollisionOption.OpenIfExists);
await MergeFolders(sourceDirectory, nextTargetSubDir);
}
}
}
}