Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # quadrupal7 root
  4. q7=/path/to/drupal7/sites/;
  5. q7l=${#q7};
  6.  
  7. # drupal 8 root
  8. d8=/path/to/drupal8/projects/;
  9. d8l=${#d8};
  10.  
  11. act=$d8;
  12. actl=$d8l;
  13.  
  14. if [[ $PWD == ${q7}* ]]; then
  15. act=$q7;
  16. actl=$q7l;
  17. fi
  18.  
  19. if [[ $PWD == ${d8}* ]]; then
  20. act=$d8;
  21. actl=$d8l;
  22. fi
  23.  
  24. arr=( $(find $act -maxdepth 1 -type d) );
  25. for i in ${arr[@]}; do
  26. if [[ $PWD == *${i}* && ${#i} -ge 5 ]]; then
  27. al=${i:actl};
  28. if [[ ${#al} -gt 0 ]]; then
  29. drush @$al $1;
  30. fi
  31. fi
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement