public static void RemoveSource(string path) { Moo.InitializeMooDir(); var sourcePaths = GetSources().Select(source => source.Path).ToList(); sourcePaths.Remove(path); var sourceContent = string.Join("\n", sourcePaths.ToArray()) + "\n"; Util.WriteFile(Moo.SourceFile, sourceContent); }
public static void AddSource(string path) { Moo.InitializeMooDir(); // if the SourceFile doesn't exist yet, // write all existing sources to the file if (!File.Exists(Moo.SourceFile)) { foreach (var source in Moo.Sources) { Util.AppendToFile(Moo.SourceFile, source.Path + "\n"); } } Util.AppendToFile(Moo.SourceFile, path + "\n"); }