Last active
December 10, 2015 00:15
-
-
Save M1ke/906be521dec222668844 to your computer and use it in GitHub Desktop.
Bower multiple install directories. For those using `bower` but not grunt who want to take advantage of the multiple cwd values described in https://github.com/bower/bower/issues/212
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install bower `npm -g install bower` | |
# Create directory in project root: | |
# bower/ | |
# Then create subdirectories for each bower setup | |
# bower/public/bower.json | |
# bower/compiled/bower.json | |
# The path installed into will be in the same directory as `bower` with the same name as the subdir | |
# ./public | |
# ./compiled | |
# The bower command (e.g. install) | |
cmd=$1 | |
# If a second argument is added it will just use that version | |
if [ $# -eq 2 ]; then | |
cd bower/$2 | |
bower $1 --config.directory="../../${PWD##*/}" | |
cd - | |
else | |
for D in `find ./bower/* -type d` | |
do | |
cd $D | |
bower $1 --config.directory="../../${PWD##*/}" | |
cd - | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also it's easy to parallelize with this setup. Just add
&
after parenthesis.