Last active
August 29, 2015 14:12
-
-
Save kyleskrinak/eb048fa36bd998a2b2c8 to your computer and use it in GitHub Desktop.
My shell script move change the location of the .git repo from localsite/themes/themename/.git to localsite/.git Note that when this script is finished you'll have to manually move the directories accordingly.
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
#!/usr/bin/env bash | |
# set -x | |
# trap read debug | |
[[ $@ ]] || { echo "Please identify theme name" ; exit 1; } | |
if [ ! -d ".git" ] | |
then | |
echo "Y U no have .git directory?" | |
exit 1 | |
fi | |
GLOBIGNORE=".git:themes" | |
mkdir -p themes/"$1" | |
for i in * | |
do | |
if [[ $(git ls-files "$i") ]] | |
then | |
echo "moving " "$i" " to themes/""$1""/""$i" | |
git mv "$i" "themes/""$1""/" | |
else | |
echo "$i" "not in repo" | |
fi | |
done | |
unset GLOBIGNORE | |
mkdir libraries modules | |
touch libraries/.keep | |
touch modules/.keep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to add the .gitignore and .gitattributes to the root directory