annotate .bash_mozilla @ 551:029c7c2c511d

stub
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 19 Nov 2013 11:58:05 -0800
parents
children 752e5eea7ea8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
551
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/bin/bash
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 # mozilla-specific bash customizations
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 MOZCONFIGS=${HOME}/mozilla/mozconfigs
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 mozconfig() {
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 if [ ! -e ${MOZCONFIGS} ]
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 then
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 echo "MOZCONFIGS directory ${MOZCONFIGS} does not exist"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 return 1
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 fi
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 if [[ "$#" == "0" ]]
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 then
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 # list the available configs
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 ls -1 ${MOZCONFIGS} | sort
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 elif [[ "$#" == "1" ]]
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 then
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 # activate the chosen mozconfig
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 name=$1
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 for _MOZCONFIG in "${MOZCONFIGS}/${name}" "${MOZCONFIGS}/mozconfig.${name}"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 do
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 echo $_MOZCONFIG
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 done
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 else
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 # print usage
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 echo "Usage: mozconfig <configname>"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 return 1
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 fi
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 }