Created
January 8, 2014 15:31
-
-
Save winmillwill/8318573 to your computer and use it in GitHub Desktop.
simple features export example in le script avec bash
This file contains 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 | |
set -ex | |
# Pass all arguments to drush | |
while [ $# -gt 0 ]; do | |
drush_flags="$drush_flags $1" | |
shift | |
done | |
drush="drush$drush_flags" | |
component_export() { | |
modules=(); | |
components=`$drush features-components --not-exported $1:% | grep -v -e "error" -e "Available"`; | |
for component in $components; do | |
module=$(echo $component | sed 's/:/_/g; s/-/_/g') | |
echo "component -> $component"; | |
echo "module -> $module"; | |
echo "$drush fe -y --destination='sites/all/modules/custom/myproject_features' $module" $component; | |
$drush fe -y --destination='sites/all/modules/custom/myproject_features' $module $component; | |
modules=("${modules[@]}" "$module"); | |
done | |
$drush en -y ${modules[@]}; | |
} | |
component_types=('commerce_product_type' 'node' 'views_view' 'context') | |
for component_type in ${component_types[@]}; do | |
echo "component type : $component_type"; | |
component_export $component_type; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment