Ejemplo n.º 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"));
        }