dev.stuconnolly.com / svn / safaritabs

  1. #! /bin/ksh
  2.  
  3. ## $Id: deploy.sh 225 2011-08-13 21:16:20Z stuart $
  4. ##
  5. ## Author:      Stuart Connolly (stuconnolly.com)
  6. ##              Copyright (c) 2011 Stuart Connolly. All rights reserved.
  7. ##
  8. ## Paramters:   <none>
  9. ##
  10. ## Description: Deploys the built plugin depending on the build configuration being used.
  11.  
  12. SIMBL_DIR='Application Support/SIMBL/Plugins'
  13. BUILD_PATH="${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}"
  14. PLUGIN_PATH="${USER_LIBRARY_DIR}/${SIMBL_DIR}/${FULL_PRODUCT_NAME}"
  15.  
  16. if [ ! -d "${USER_LIBRARY_DIR}/${SIMBL_DIR}" ]
  17. then
  18.     echo "SIMBL plugin directory does not exist at '${USER_LIBRARY_DIR}/${SIMBL_DIR}' so creating it..."
  19.  
  20.     mkdir "${USER_LIBRARY_DIR}/${SIMBL_DIR}"
  21. fi
  22.  
  23. # Clean up any previous products/symbolic links in SIMBL's plugin directory
  24. if [ -e "$PLUGIN_PATH" ]
  25. then
  26.     rm -rf "$PLUGIN_PATH"
  27. fi
  28.  
  29. # Depending on the build configuration, either copy or link to the most recent build
  30. if [ "$CONFIGURATION" == 'Development' ]
  31. then
  32.     # If we are developing, add a symbolic link to the plugin
  33.     ln -sf "$BUILD_PATH" "$PLUGIN_PATH"
  34. elif [ "$CONFIGURATION" == 'Release' ]
  35. then
  36.     # If we are compiling for release, copy the plugin to SIMBL's plugin directory
  37.     cp -rpf "$BUILD_PATH" "$PLUGIN_PATH"
  38. fi
  39.  
  40. exit 0
  41.