File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed
Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ #
3+ # Execute a command in each subfolder.
4+ #
25
3- BUNDLE_DEPENDENCIES=$( curl --silent https://raw.githubusercontent.com/wp-cli/wp-cli-bundle/master/composer.json -q | jq ' .["require"] | keys[]' )
4- BUNDLE_DEPENDENCIES=$( echo " wp-cli/wp-cli-bundle $BUNDLE_DEPENDENCIES " )
6+ get_bundle_dependencies ()
7+ {
8+ echo " wp-cli/wp-cli-bundle"
9+ curl --silent " https://raw.githubusercontent.com/wp-cli/wp-cli-bundle/master/composer.json" \
10+ | jq --raw-output ' ."require" | keys[] | select(startswith("wp-cli/"))'
11+ }
512
6- for NAME in $BUNDLE_DEPENDENCIES ; do
7-
8- REPO=$( echo $NAME | tr -d ' "' )
9- case $REPO in wp-cli/* )
10- export REPO=$( echo " $REPO " | sed -e " s|^wp-cli/||" )
11- if [ -d " $REPO " ]; then
12- OLDPWD=" $( pwd) "
13- cd " $REPO "
14- echo " --- $REPO : ---"
15- " $@ "
16- cd " $OLDPWD "
17- fi
18- esac
19- done
13+ while read -r dependency; do
14+ # Remove wp-cli/ prefix
15+ repo_path=" ${dependency: 7} "
16+ if [ ! -d " ${repo_path} " ]; then
17+ continue
18+ fi
2019
20+ echo " --- ${repo_path} : ---"
21+ cd " ${repo_path} "
22+ bash -c " $@ "
23+ cd -
24+ done <<< " $(get_bundle_dependencies)"
You can’t perform that action at this time.
0 commit comments