Kiln » Kiln Storage Service Read More
Clone URL:  
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System; using System.IO; using Microsoft.Win32; namespace RepoDirectoryMigrator { class Program { static void Main(string[] args) { var repoRoot = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Fog Creek Software\Kiln", "KilnRepositoryRoot", null); if (string.IsNullOrEmpty(repoRoot)) { Console.Error.WriteLine("KEY NOT FOUND!"); Environment.Exit(1); } var repositories = Directory.GetDirectories(repoRoot, "????????-????-????-????-????????????"); foreach (var path in repositories) { var repo = Path.GetFileName(path); var part1 = Path.Combine(repoRoot, repo.Substring(0, 2)); var part2 = Path.Combine(part1, repo.Substring(2, 2)); Directory.CreateDirectory(part1); Directory.CreateDirectory(part2); Directory.Move(path, Path.Combine(part2, repo)); } Console.Error.WriteLine("SUCCESS!"); } } }