diff --git a/config/plugins/bower.coffee b/config/plugins/bower.coffee index 3d0c956..8e0fda7 100644 --- a/config/plugins/bower.coffee +++ b/config/plugins/bower.coffee @@ -1,3 +1,6 @@ +fs = require('fs') +path = require('path') + module.exports = (lineman) -> config: loadNpmTasks: lineman.config.application.loadNpmTasks.concat("grunt-bower-task") @@ -7,9 +10,14 @@ module.exports = (lineman) -> clean: bower: - src: "vendor/bower" + src: bowerDirectory(lineman.grunt) bower: install: options: copy: false + +bowerDirectory = (grunt) -> + bowerrc = path.join(process.cwd(), ".bowerrc") + bowerConfig = grunt.file.readJSON(bowerrc) unless !fs.existsSync(bowerrc) + bowerConfig?.directory || "vendor/bower"