diff --git a/scripts/create-dev-env.sh b/scripts/create-dev-env.sh index 56fd744972..06d31e9993 100755 --- a/scripts/create-dev-env.sh +++ b/scripts/create-dev-env.sh @@ -49,8 +49,11 @@ usage() { Usage: $PROG [-c] [-v] [-h] + -y non interactive mode (no prompt, proceed immediately) -c compile scipy and numpy + -n do not attempt to pull edx-platform -s give access to global site-packages for virtualenv + -q be more quiet (removes info at beginning & end) -v set -x + spew -h this @@ -78,21 +81,23 @@ change_git_push_defaults() { clone_repos() { - change_git_push_defaults - cd "$BASE" - if [[ -d "$BASE/edx-platform/.git" ]]; then - output "Pulling edx platform" - cd "$BASE/edx-platform" - git pull - else - output "Cloning edx platform" - if [[ -d "$BASE/edx-platform" ]]; then - output "Creating backup for existing edx platform" - mv "$BASE/edx-platform" "${BASE}/edx-platform.bak.$$" + if [[ ! $nopull ]]; then + change_git_push_defaults + + if [[ -d "$BASE/edx-platform/.git" ]]; then + output "Pulling edx platform" + cd "$BASE/edx-platform" + git pull + else + output "Cloning edx platform" + if [[ -d "$BASE/edx-platform" ]]; then + output "Creating backup for existing edx platform" + mv "$BASE/edx-platform" "${BASE}/edx-platform.bak.$$" + fi + git clone https://github.com/edx/edx-platform.git fi - git clone https://github.com/edx/edx-platform.git fi } @@ -149,7 +154,7 @@ if [[ "x$VIRTUAL_ENV" != "x" ]]; then fi # Read arguments -ARGS=$(getopt "cvhs" "$*") +ARGS=$(getopt "cvhsynq" "$*") if [[ $? != 0 ]]; then usage exit 1 @@ -170,6 +175,18 @@ while true; do verbose=true shift ;; + -y) + noninteractive=true + shift + ;; + -q) + quiet=true + shift + ;; + -n) + nopull=true + shift + ;; -h) usage exit 0 @@ -181,7 +198,8 @@ while true; do esac done -cat<