Skip to content

Commit

Permalink
Fix #94
Browse files Browse the repository at this point in the history
  • Loading branch information
UnbounDev committed Jun 11, 2015
1 parent cdbcac6 commit ec9a48f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions tasks/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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
}
}
}

0 comments on commit ec9a48f

Please sign in to comment.