Last active
December 27, 2015 02:49
-
-
Save nvivo/7254852 to your computer and use it in GitHub Desktop.
Cassette Extension to add multiple folders to a single bundle
This file contains hidden or 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
public static class BundleCollectionExtensions | |
{ | |
public static void AddMultipleDirectories<T>(this BundleCollection bundles, string appRelativePath, params string[] directories) | |
where T : Bundle | |
{ | |
var list = new List<string>(); | |
foreach (var dir in directories) | |
{ | |
bundles.Add<T>(dir); | |
var bundle = bundles.Get<T>(dir); | |
bundles.Remove(bundle); | |
list.AddRange(bundle.Assets.Select(a => a.Path)); | |
} | |
bundles.Add<T>(appRelativePath, list); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment