Skip to content

Instantly share code, notes, and snippets.

@kyleskrinak
Last active August 29, 2015 14:12
Show Gist options
  • Save kyleskrinak/eb048fa36bd998a2b2c8 to your computer and use it in GitHub Desktop.
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.
#!/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
@kyleskrinak
Copy link
Author

Need to add the .gitignore and .gitattributes to the root directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment