Skip to content

Instantly share code, notes, and snippets.

@rstackhouse
Last active December 19, 2015 15:19
Show Gist options
  • Save rstackhouse/5975548 to your computer and use it in GitHub Desktop.
Save rstackhouse/5975548 to your computer and use it in GitHub Desktop.
Turn Chirpy Minify flags on and off via LinqPad script
var scriptsDotChirpDotConfig = @"C:\Users\rstackhouse\Desktop\WellTrak AFE\trunk\CostTrak\UI\Web\Admin\Administration\Scripts\scripts.chirp.config";
var xDoc = XDocument.Load(scriptsDotChirpDotConfig);
xDoc.Descendants("FileGroup").ToList().ForEach(x => {
//Default for a FileGroup is to minify. Remove the attribute.
var attr = x.Attribute("Minify");
if (attr != null)
{
attr.Remove();
}
});
xDoc.Dump(); //Dump is a LinqPad extension method.
xDoc.Save(scriptsDotChirpDotConfig);
var scriptsDotChirpDotConfig = @"C:\Users\rstackhouse\Desktop\WellTrak AFE\trunk\CostTrak\UI\Web\Admin\Administration\Scripts\scripts.chirp.config";
var xDoc = XDocument.Load(scriptsDotChirpDotConfig);
xDoc.Descendants("FileGroup").ToList().ForEach(x => {
XAttribute attr = x.Attribute("Minify");
if (attr == null) {
x.Add(new XAttribute("Minify", "false"));
}
else {
//Ensure value is "false"
attr.Value = "false";
}
});
xDoc.Dump(); //Dump is a LinqPad extension method.
xDoc.Save(scriptsDotChirpDotConfig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment