Skip to content

Instantly share code, notes, and snippets.

@garuma
Created August 9, 2012 15:27
Show Gist options
  • Save garuma/3305114 to your computer and use it in GitHub Desktop.
Save garuma/3305114 to your computer and use it in GitHub Desktop.
#!/usr/bin/csharp
LoadAssembly ("System.Xml.Linq.dll");
using System.Xml.Linq;
using System.IO;
var files = Environment.GetEnvironmentVariable ("FILES").Split ().Where (f => File.Exists (f));
var mainFile = files.First ();
var main = XDocument.Load (mainFile);
foreach (var other in files.Skip (1).Select (d => XDocument.Load (d))) {
main.Root.Element ("Assemblies").Add (other.Root.Element ("Assemblies").Elements ());
main.Root.Element ("Types").Add (other.Root.Element ("Types").Elements ());
}
main.Save (mainFile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment