Commit 195fa158 by Bridger Maxwell

Changed setup script to pull instead of clone if the repo already exists.

parent 6c4a3cf6
...@@ -48,21 +48,45 @@ EO ...@@ -48,21 +48,45 @@ EO
clone_repos() { clone_repos() {
cd "$BASE" cd "$BASE"
output "Cloning mitx"
if [[ -d "$BASE/mitx" ]]; then if [[ -d "$BASE/mitx/.git" ]]; then
mv "$BASE/mitx" "${BASE}/mitx.bak.$$" output "Pulling mitx"
fi cd "$BASE/mitx"
git clone git@github.com:MITx/mitx.git >>$LOG git pull >>$LOG
output "Cloning askbot-devel" else
if [[ -d "$BASE/askbot-devel" ]]; then output "Cloning mitx"
mv "$BASE/askbot-devel" "${BASE}/askbot-devel.bak.$$" if [[ -d "$BASE/mitx" ]]; then
fi mv "$BASE/mitx" "${BASE}/mitx.bak.$$"
git clone git@github.com:MITx/askbot-devel >>$LOG fi
output "Cloning data" git clone git@github.com:MITx/mitx.git >>$LOG
if [[ -d "$BASE/data" ]]; then fi
mv "$BASE/data" "${BASE}/data.bak.$$"
fi cd "$BASE"
hg clone ssh://hg-content@gp.mitx.mit.edu/data >>$LOG if [[ -d "$BASE/askbot-devel/.git" ]]; then
output "Pulling askbot-devel"
cd "$BASE/askbot-devel"
git pull >>$LOG
else
output "Cloning askbot-devel"
if [[ -d "$BASE/askbot-devel" ]]; then
mv "$BASE/askbot-devel" "${BASE}/askbot-devel.bak.$$"
fi
git clone git@github.com:MITx/askbot-devel >>$LOG
fi
cd "$BASE"
if [[ -d "$BASE/data/.hg" ]]; then
output "Pulling data"
cd "$BASE/data"
hg pull >>$LOG
hg update >>$LOG
else
output "Cloning data"
if [[ -d "$BASE/data" ]]; then
mv "$BASE/data" "${BASE}/data.bak.$$"
fi
hg clone ssh://hg-content@gp.mitx.mit.edu/data >>$LOG
fi
} }
PROG=${0##*/} PROG=${0##*/}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment