Commits

Rod Morison committed ac2672c Draft

Minor cleanup to bootstrap script user messaging

Comments (0)

Files changed (1)

-#!/bin/bash
+#!/usr/bin/env bash
+
+function echorun {
+    echo $*
+    $*
+}
+
+if [ "$SHELL" != "/bin/bash" ] ; then
+    echo Invoked via $SHELL ...
+    echo Please invoke with bash
+    exit 1
+fi
 
 #
 # Install some Ubuntu dev essentials, inc a system fabric install, via pip
 #
+echo
+echo setting up some initial packages and scm...
+echo you\'ll need to give sudo appropriate credentials
+echo
 
-# setup initial .hgrc
+# basic scm tools
+echorun sudo apt-get -q --yes install mercurial git subversion
+
+# setup initial .hgrc and git id
 if ! grep '\[ui\]' $HOME/.hgrc &>/dev/null ; then
-    echo -n "Human name for hg: " ; read name
-    echo -n "Email address for hg: "; read email
+    echo creating ~/.hgrc \[ui\] section, git config user.name/email
+    echo -n "Human name: " ; read name
+    echo -n "Email address: "; read email
     echo "
 [ui]
 username = $name <$email>
 " >> $HOME/.hgrc
     git config --global user.name "$name"
     git config --global user.email "$email"
+else
+    echo ~/.hgrc already has a \[ui\] section, skipping hg/git user/email setup
 fi
 
-sudo apt-get -q --yes install mercurial git subversion
-
 # ssh server, on which fabric relies, and curl, which gets used here-n-there
-sudo apt-get -q --yes install openssh-server curl
+echorun sudo apt-get -q --yes install openssh-server curl
 
 # python, pip & fabric
-sudo apt-get -q --yes install build-essential python-setuptools python-dev python-software-properties
-sudo easy_install pip     # no pip package in ubuntu < 10, so use easy_install
-sudo pip install 'fabric>=1.0'
+echorun sudo apt-get -q --yes install build-essential python-setuptools python-dev python-software-properties
+echorun sudo easy_install pip     # no pip package in ubuntu < 10, so use easy_install
+echorun sudo pip install --upgrade 'fabric>=1.0'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.