private void AddGitIgnore(SolutionItems items) { const string gitignore = ".gitignore"; if (!File.Exists(gitignore)) { var gi = new GitIgnore(new GitIgnoreCommand { Fix = true }); gi.WriteGitIgnore(); } items.Add(gitignore); }
//[HelpOption] //public override string Help() //{ // var sb = new StringBuilder(base.Help()); // sb.AppendLine("use -a or --add to only add in missing gitignores. Use instead of fix"); // sb.AppendLine("use -m or --merge to check or fix comparing/merging with latest visual studio gitignore file. Works with check and fix options"); // sb.AppendLine("use -s or --strict to ensure the most extensive pattern is used. Combine with -f"); // sb.AppendLine( // "use -r or --replace to replace existing gitignores, or add where missing, with the latest visual studio gitignore file"); // sb.AppendLine("use -l or --latestgit if you have version >= 2.0.1 of git, then the gitignore will be a few lines shorter. Latest Windows git is currently 1.9.4"); // return sb.ToString(); //} public override int Execute() { var fixer = new GitIgnore(Directory.GetCurrentDirectory()); return(fixer.Execute(this)); }