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"
if [[ -d "$BASE/mitx/.git" ]]; then
output "Pulling mitx"
cd "$BASE/mitx"
git pull >>$LOG
else
output "Cloning mitx" output "Cloning mitx"
if [[ -d "$BASE/mitx" ]]; then if [[ -d "$BASE/mitx" ]]; then
mv "$BASE/mitx" "${BASE}/mitx.bak.$$" mv "$BASE/mitx" "${BASE}/mitx.bak.$$"
fi fi
git clone git@github.com:MITx/mitx.git >>$LOG git clone git@github.com:MITx/mitx.git >>$LOG
fi
cd "$BASE"
if [[ -d "$BASE/askbot-devel/.git" ]]; then
output "Pulling askbot-devel"
cd "$BASE/askbot-devel"
git pull >>$LOG
else
output "Cloning askbot-devel" output "Cloning askbot-devel"
if [[ -d "$BASE/askbot-devel" ]]; then if [[ -d "$BASE/askbot-devel" ]]; then
mv "$BASE/askbot-devel" "${BASE}/askbot-devel.bak.$$" mv "$BASE/askbot-devel" "${BASE}/askbot-devel.bak.$$"
fi fi
git clone git@github.com:MITx/askbot-devel >>$LOG 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" output "Cloning data"
if [[ -d "$BASE/data" ]]; then if [[ -d "$BASE/data" ]]; then
mv "$BASE/data" "${BASE}/data.bak.$$" mv "$BASE/data" "${BASE}/data.bak.$$"
fi fi
hg clone ssh://hg-content@gp.mitx.mit.edu/data >>$LOG 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