Created
March 27, 2013 17:07
-
-
Save eddiemoya/5256085 to your computer and use it in GitHub Desktop.
This file contains 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 | |
SYNC_BIN_PATH=`dirname $(readlink -f $0)` | |
TMP_PATH="$SYNC_BIN_PATH/tmp" | |
REPO_PLUGINS="$SYNC_BIN_PATH/uxwpress/plugins/*" | |
NEW_REPO_PLUGINS="$SYNC_BIN_PATH/plugins" | |
for i in $REPO_PLUGINS | |
do | |
CURRENT_PLUGIN_NAME=`basename "$i"` | |
cd "$i" | |
rm -rf "$TMP_PATH/$CURRENT_PLUGIN_NAME" | |
mkdir "$TMP_PATH/$CURRENT_PLUGIN_NAME" | |
git format-patch -o "$TMP_PATH/$CURRENT_PLUGIN_NAME" \ | |
$(git log "$i"|grep ^commit|tail -1|awk '{print $2}')^..HEAD \ | |
"$i" | |
rm -rf "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME" | |
mkdir "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME" | |
cd "$NEW_REPO_PLUGINS/$CURRENT_PLUGIN_NAME" | |
git init | |
git am "$TMP_PATH/$CURRENT_PLUGIN_NAME/"*.patch | |
git mv plugins/$CURRENT_PLUGIN_NAME/* ./ | |
git commit -a -m "Moving plugin to root of repo." | |
rm -rf ./plugins | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment