Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.04 KB | None | 0 0
  1. #!/bin/bash
  2. BASEDIR=`php -r "echo dirname(realpath('$0'));"`
  3. OLDDIR=`pwd`
  4. cd $BASEDIR
  5.  
  6. mkdir old_contrib
  7. mkdir old_contrib/modules
  8. for contrib in modules/contrib modules/development libraries translations
  9. do
  10.     mv -f $contrib old_contrib/$contrib
  11. done
  12.  
  13. # Exclude custom theme from deletion.
  14. mkdir old_contrib/themes
  15. find themes -mindepth 1 -maxdepth 1 -not -name "rwce" -exec mv {} old_contrib/themes \;
  16.  
  17. drush make $1 --working-copy --no-core --contrib-destination=. rwce.make
  18. # If the drush make ran without errors, we can continue
  19. RETVAL=$?
  20. if [ $RETVAL -eq 0 ]; then
  21.     ./copy_and_patch_locally.sh
  22.     # If we still have no errors, go ahead and delete the backups
  23.     RETVAL=$?
  24.     if [ $RETVAL -eq 0 ]; then
  25.         rm -rf old_contrib
  26.         echo "backups deleted"
  27.     else
  28.         echo "There was a problem with local patches. Backups have been left intact."
  29.     fi
  30. else
  31.     # Things went wrong - back-up from old_contrib
  32.     rsync -av old_contrib/ .
  33.     rm -rf old_contrib
  34. fi
  35.  
  36.  
  37. # Go back where we came from.
  38. cd $OLDDIR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement