Skip to content

Commit

Permalink
fallback to bower_components/lightbox instead of bower_components/lig…
Browse files Browse the repository at this point in the history
…htbox2
  • Loading branch information
ramybenaroya committed Jun 1, 2017
1 parent b3386c6 commit da6a493
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ module.exports = {
},
included: function lightbox_included(app) {
this._super.included.apply(this, arguments);
var lightboxPath = path.join(app.bowerDirectory, 'lightbox', 'dist'),
lightboxCssContent = fs.readFileSync(path.join(lightboxPath, 'css', 'lightbox.css'),'utf8');
var lightboxPath = path.join(app.bowerDirectory, 'lightbox2', 'dist');
var lightboxCssContent;

if (!fs.existsSync(lightboxPath)) {
lightboxPath = path.join(app.bowerDirectory, 'lightbox', 'dist');
}

lightboxCssContent = fs.readFileSync(path.join(lightboxPath, 'css', 'lightbox.css'),'utf8');
lightboxCssContent = lightboxCssContent.replace(/\.\.\/images\//g, 'images/lightbox/');
fs.writeFileSync(path.join(lightboxPath, 'css', 'lightbox.processed.css'), lightboxCssContent);
this.app.import(path.join(lightboxPath, 'js', 'lightbox.js'));
Expand Down

0 comments on commit da6a493

Please sign in to comment.