diff --git a/tasks/sync.js b/tasks/sync.js index f6b0fc8..1f4e9f9 100644 --- a/tasks/sync.js +++ b/tasks/sync.js @@ -133,11 +133,26 @@ function _syncLibrary(dbs, cdnName, libraryName, cb) { _.extend(_item, item); collection.update(_item); } + } - // clean up - item = null; + // quick hack to fix #94 + if(cdnName === "bootstrap-cdn" && library.name === "twitter-bootstrap") { + var item = _.pick(library, schemaKeys); + _.defaults(item, dbs._schema); + item.name = "bootstrap"; + var _item = collection.findOne({"name": item.name}); + if (!_item) { + collection.insert(item); + } + else { + _.extend(_item, item); + collection.update(_item); + } } + // clean up + item = null; + // and return cb(); }); @@ -169,3 +184,12 @@ function _upsertCDNEtags(etagsCollection, cdn, etags) { etagsCollection.update(cdnEtags); } } + +function _catchBootstrap() { + if(cdn === "bootstrap-cdn") { + var bootstrapTwitterEtag = _.find(remoteEtags, {path: "bootstrap-twitter"}); + if(bootstrapTwitterEtag) { + bootstrapTwitterEtag.path + } + } +} \ No newline at end of file