From b46b7daf0f8aae5454f1496cf88b8531cdb473cc Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Fri, 8 Jun 2012 14:59:21 -0400 Subject: [PATCH] added a posix compliant check to make sure you are using bash to run the script, added option to use --system-site-packages for virtualenv, updated the ending instructions on how to start the server --- create-dev-env.sh | 57 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/create-dev-env.sh b/create-dev-env.sh index 9e644fe046..7b798c5b8c 100755 --- a/create-dev-env.sh +++ b/create-dev-env.sh @@ -1,5 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash set -e + +# posix compliant sanity check +if [ -z $BASH ] || [ $BASH = "/bin/sh" ]; then + echo "Please use the bash interpreter to run this script" + exit 1 +fi + trap "ouch" ERR ouch() { @@ -29,6 +36,7 @@ usage() { Usage: $PROG [-c] [-v] [-h] -c compile scipy and numpy + -s --system-site-packages for virtualenv -v set -x + spew -h this @@ -106,7 +114,7 @@ if [[ $EUID -eq 0 ]]; then usage exit 1 fi -ARGS=$(getopt "cvh" "$*") +ARGS=$(getopt "cvhs" "$*") if [[ $? != 0 ]]; then usage exit 1 @@ -118,6 +126,10 @@ while true; do compile=true shift ;; + -s) + systempkgs=true + shift + ;; -v) set -x verbose=true @@ -148,7 +160,7 @@ cat< + + $ rake django-admin[runserver,lms,dev,] + + If the Django development server starts properly you + should see: + + Development server is running at http://127.0.0.1:/ + Quit the server with CONTROL-C. + + Connect your browser to http://127.0.0.1: to + view the Django site. + + END exit 0