Last active
December 19, 2015 15:19
-
-
Save rstackhouse/5975548 to your computer and use it in GitHub Desktop.
Turn Chirpy Minify flags on and off via LinqPad script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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