Files
OurUmbraco/OurUmbraco.Site/macroScripts/Documentation-GithubSync.cshtml
T
2013-01-18 13:17:56 +01:00

28 lines
885 B
Plaintext

@{
if (string.IsNullOrEmpty(Request["id"]))
{
const string rootFolder = @"~\Documentation";
const string config = @"~\config\githubpull.config";
var rootFolderPath = HttpContext.Current.Server.MapPath(rootFolder);
var configPath = HttpContext.Current.Server.MapPath(config);
if (!Directory.Exists(rootFolderPath))
{
Directory.CreateDirectory(rootFolderPath);
}
var unzip = new uDocumentation.Busineslogic.GithubSourcePull.ZipDownloader(rootFolderPath, configPath);
unzip.Run();
}
else
{
int id = 0;
if (int.TryParse(Request["id"], out id))
{
uDocumentation.Busineslogic.GithubSourcePull.ZipDownloader zip = new uDocumentation.Busineslogic.GithubSourcePull.ZipDownloader(id);
zip.Run();
}
}
}