Exemple #1
0
        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"));
        }
Exemple #2
0
 public void CreatePage([FromBody] SaveDto data)
 {
     GitHelpers.Commit(Constants.RepositoryFolder, data.Path.Replace("/", "\\"), KB.Resource.NewPage, "test", Configuration.GetValue <string>("repositoryUser", null), Configuration.GetValue <string>("password", null));
     RepositoryStructure.Initialize();
 }