Skip to content

Instantly share code, notes, and snippets.

@eddiemoya
Last active December 21, 2015 11:08
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 eddiemoya/6296414 to your computer and use it in GitHub Desktop.
Save eddiemoya/6296414 to your computer and use it in GitHub Desktop.
#!/bin/bash
# readlink -f resolves symlinks but doesnt work on OSX or BSD.
# SYNC_BIN_PATH=`dirname $(readlink -f $0)`
# pwd is lazy, doesnt resolve symlinks, but works everywhere.
SYNC_BIN_PATH=$(pwd)
TMP_PATH="$SYNC_BIN_PATH/tmp"
REPO_PLUGINS="$SYNC_BIN_PATH/uxwpress/plugins/"
NEW_REPO_PLUGINS="$SYNC_BIN_PATH/plugins"
for i in `find "$REPO_PLUGINS" -maxdepth 1 -type d`
do
echo $i
if [ -d "$i" ]; then
CURRENT_PLUGIN_NAME=`basename "$i"`
if [ "$CURRENT_PLUGIN_NAME" == "plugins" ]; then
continue
fi
rm -rf "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME"
git clone file:///home/brian/Projects/shc/uxwpress "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME"
cd "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME"
git filter-branch --subdirectory-filter plugins/$CURRENT_PLUGIN_NAME -- --all
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment