Files
OurUmbraco/OurUmbraco.Site/macroScripts/Documentation-GithubSync.cshtml
T
Per Ploug db87db8e72 Refactored docs navigation
Moved everything to razor, removed loads of old crap, added new
navigation, breadcrumb and markdown render - still weird but better
2015-02-24 00:20:13 +01:00

30 lines
983 B
Plaintext

@inherits umbraco.MacroEngines.DynamicNodeContext
@{
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.IsProjectDocumentation = true;
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();
}
}
}