Skip to content

Instantly share code, notes, and snippets.

@mintindeed
Created January 22, 2013 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mintindeed/4600011 to your computer and use it in GitHub Desktop.
Save mintindeed/4600011 to your computer and use it in GitHub Desktop.
#!/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