jasonlewis / basset

A better asset management package for Laravel.
http://jasonlewis.me/code/basset
240 stars 76 forks source link

Error on empty collection #191

Open barryvdh opened 11 years ago

barryvdh commented 11 years ago

This is probably an edge case, but I have a collection, ie 'admin', which can contain both javascript and stylesheet. So in my head I call @stylesheets('admin') and in my footer @javascripts('admin'). But when there is no stylesheet, it tries to write to app/storage/meta/collection.json. This is no problem in development, but when I publish the app to production (with Rocketeer) the following order happens:

  1. Clone, install and set app/storage to 777 recursively.
  2. Build all basset collections (and thus create app/storage/meta/collection.json)
  3. When the previous described case happens, it cannot write to the meta files, because it is created by the CLI user, not web (and before chmodding), so an error occurs, but the layout continues to be created, but using a different layout file (probably because of the error template or something).

So it is pretty strange, but as soon as I remove the stylesheets('admin'), everything worked as useal again.

Obviously this is easy for me to work around, by just removing that line or splitting the collections in css and javascript, but I think this shouldn't actually occur.