1
|
#!/bin/sh
|
2
|
PATH=/usr/local/bin:/usr/bin:/bin
|
3
|
|
4
|
#if user didn't pass the argument to script, help them know how to use the script
|
5
|
if [ $# -lt 1 ]; then
|
6
|
echo "usage: $0 <drush args>"
|
7
|
exit 1
|
8
|
fi
|
9
|
|
10
|
cd /users/guest/assos/html/sites
|
11
|
|
12
|
#Only be intersted in a drupal site folder
|
13
|
for x in $(ls -1 | grep -v 'all' | grep -v file-*); do
|
14
|
|
15
|
#if it's actually a directory and it's not a symbolic link
|
16
|
if [ -d $x -a ! -L $x ]; then
|
17
|
cd $x;
|
18
|
|
19
|
#list all non core projects that are enabled for the site, then filter the display to only show the status of the project we're interested in
|
20
|
#if the project is not enabled then we couldn't even see a line corresponding to it as the drush command specifies --status=enabled
|
21
|
#if the project is enabled, then it appears in drush command output, we then count the number of lines the output prints. this number could only
|
22
|
#be 1 or 0
|
23
|
#if it's 1, then the project is enabled on the being tested folder, the name of the so called folder is printed !
|
24
|
#Shame on me and my ugly code !
|
25
|
if [ 1 = `drush pml --no-core --status=enabled | grep $1 | wc -l` ]; then
|
26
|
echo $x;
|
27
|
fi
|
28
|
cd -;
|
29
|
fi
|
30
|
done
|