Skip to content

Commit

Permalink
Adds support to the .bowerrc file to get the directory path
Browse files Browse the repository at this point in the history
  • Loading branch information
blackjid committed Oct 1, 2013
1 parent efb2365 commit 333556f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ or can be run in isolation with `cap production bower:install`

Configurable options, shown here with defaults:

set :bower_dir, -> { (shared_path.relative_path_from release_path).join('bower_components') }
set :bower_dir, -> { (shared_path.relative_path_from release_path).join((JSON.parse(File.read(".bowerrc")) rescue {}).fetch("directory", "bower_components")) }
set :bower_cwd, -> { release_path }
set :bower_flags, '--quiet'
set :bower_roles, :all
Expand Down
5 changes: 3 additions & 2 deletions lib/capistrano/tasks/bower.tasks
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pathname'
require 'json'

namespace :bower do
desc <<-DESC
Expand All @@ -7,7 +8,7 @@ namespace :bower do

You can override any of these defaults by setting the variables shown below.

set :bower_dir, -> { (shared_path.relative_path_from release_path).join('bower_components') }
set :bower_dir, -> { (shared_path.relative_path_from release_path).join((JSON.parse(File.read(".bowerrc")) rescue {}).fetch("directory", "bower_components")) }
set :bower_cwd, -> { release_path }
set :bower_flags, '--quiet'
set :bower_roles, :all
Expand All @@ -28,7 +29,7 @@ end

namespace :load do
task :defaults do
set :bower_dir, -> { (shared_path.relative_path_from release_path).join('bower_components') }
set :bower_dir, -> { (shared_path.relative_path_from release_path).join((JSON.parse(File.read(".bowerrc")) rescue {}).fetch("directory", "bower_components")) }
set :bower_cwd, -> { release_path }
set :bower_flags, '--quiet'
set :bower_roles, :all
Expand Down

0 comments on commit 333556f

Please sign in to comment.