You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
769 B
Plaintext
40 lines
769 B
Plaintext
13 years ago
|
#!/bin/bash
|
||
|
|
||
|
if [[ ! -d .git ]]; then
|
||
|
echo "This script can only be run from a top level git directory. Exiting..."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo "Preparing $PWD for development use"
|
||
|
if [[ $1 == "" ]]; then
|
||
|
read -p "Enter your TDE GIT username []: " -e gituser
|
||
|
fi
|
||
|
|
||
|
if [[ $gituser == "" ]]; then
|
||
|
gituser="anonymous"
|
||
|
fi
|
||
|
|
||
|
THISSCRIPT=$(readlink -f $0)
|
||
|
|
||
|
if [[ ! -e "$THISSCRIPT" ]]; then
|
||
|
echo "Unable to find myself! Exiting..."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
git reset --hard HEAD
|
||
|
git clean -dxf
|
||
|
|
||
|
if [[ -e .gitmodules ]]; then
|
||
|
if [[ $1 == "anonymous" ]]; then
|
||
|
sed -i 's/system@//g' .gitmodules
|
||
|
else
|
||
|
sed -i "s/system@/$1@/g" .gitmodules
|
||
|
fi
|
||
|
|
||
|
git submodule init
|
||
|
git submodule update
|
||
|
git submodule foreach "'git checkout master && git pull && $THISSCRIPT $1'"
|
||
|
|
||
|
git checkout -- .gitmodules
|
||
|
fi
|