Created
January 22, 2013 23:45
-
-
Save mintindeed/4600011 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
PLUGIN_DIR="/cygdrive/r/bgr/plugins" | |
SITE_ROOT="/cygdrive/r/bgr/bgr2010" | |
DRY_RUN=01 | |
if [[ "$DRY_RUN" -eq "0" ]] ; then | |
DRY_RUN="" | |
else | |
DRY_RUN="--dry-run" | |
echo "*** DRY RUN ***" | |
fi | |
if [[ -z "$1" ]] ; then | |
echo "Usage: $0 <plugin_to_update>" | |
exit 1 | |
else | |
PLUGIN="${1%/}" | |
PLUGIN="${PLUGIN##plugins/}" | |
fi | |
if [[ ! -d "$PLUGIN_DIR/$PLUGIN" ]] ; then | |
echo "Error: Source $PLUGIN_DIR/$PLUGIN does not exist." | |
exit 1 | |
fi | |
if [[ ! -d "$SITE_ROOT/wp-content/plugins/$PLUGIN" ]] ; then | |
echo "Error: Destination $SITE_ROOT/wp-content/plugins/$PLUGIN does not exist." | |
exit 1 | |
fi | |
rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $PLUGIN_DIR/$PLUGIN $SITE_ROOT/wp-content/plugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment