Created
          June 13, 2012 08:43 
        
      - 
      
- 
        Save pbroschwitz/2922859 to your computer and use it in GitHub Desktop. 
    Clean cache directories
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/usr/bin/env bash | |
| #SCRIPT_PATH="$(readlink -f $0)" | |
| #SCRIPT_DIR="$(dirname ${SCRIPT_PATH})" | |
| SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd)" | |
| function deleteIfExisting { | |
| local dirToDel="${SCRIPT_DIR}/${1}" | |
| if [[ -w "${dirToDel}" ]] ; then | |
| echo "Deleting '${dirToDel}' ..." | |
| #ls -al "${dirToDel}" | |
| rm -r "${dirToDel}"; | |
| mkdir "${dirToDel}"; | |
| chmod 777 "${dirToDel}"; | |
| #ls -al "${dirToDel}" | |
| fi | |
| } | |
| deleteIfExisting "_htdocs/cms/cache/images" | |
| deleteIfExisting "_htdocs/cms/cache/smarty/templates_c" | |
| deleteIfExisting "_htdocs/cms/cache/strings" | |
| deleteIfExisting "_htdocs/cms/inc/compiled" | |
| deleteIfExisting "_htdocs/asset/global/compiled" | |
| echo "Done." | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment