public IActionResult Index() { if (!GitHelpers.IsInitialized(Constants.RepositoryFolder)) { return(RedirectToAction("Initialize")); } return(View()); }
public IActionResult Clone(string url) { if (!GitHelpers.IsInitialized(Constants.RepositoryFolder)) { GitHelpers.Clone(Constants.RepositoryFolder, url, Configuration.GetValue <string>("repositoryUser", null), Configuration.GetValue <string>("password", null)); RepositoryStructure.Initialize(); } return(RedirectToAction("Index")); }
public IActionResult Init(string url) { if (!GitHelpers.IsInitialized(Constants.RepositoryFolder)) { GitHelpers.Init(Constants.RepositoryFolder); if (!string.IsNullOrWhiteSpace(url)) { GitHelpers.AddRemote(Constants.RepositoryFolder, url); GitHelpers.Commit(Constants.RepositoryFolder, "\\index.md", "## Welcome to your new KB", "test", Configuration.GetValue <string>("repositoryUser", null), Configuration.GetValue <string>("password", null)); RepositoryStructure.Initialize(); } } return(RedirectToAction("Index")); }