Skip to content

Instantly share code, notes, and snippets.

@nvivo
Last active December 27, 2015 02:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvivo/7254852 to your computer and use it in GitHub Desktop.
Save nvivo/7254852 to your computer and use it in GitHub Desktop.
Cassette Extension to add multiple folders to a single bundle
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