(minor) gl-setup learns "-q"

suppresses popping an editor when run for the first time
This commit is contained in:
Sitaram Chamarty 2011-01-16 14:42:11 +05:30
parent 692552d146
commit 3c1633c659

View file

@ -28,6 +28,13 @@ TEMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
export TEMPDIR export TEMPDIR
trap "/bin/rm -rf $TEMPDIR" 0 trap "/bin/rm -rf $TEMPDIR" 0
# quiet mode; only used to suppress popping up an editor on a new rc file
if [ "$1" = "-q" ]
then
shift
quiet=1
fi
if [ -n "$GITOLITE_HTTP_HOME" ] if [ -n "$GITOLITE_HTTP_HOME" ]
then then
HOME=$GITOLITE_HTTP_HOME HOME=$GITOLITE_HTTP_HOME
@ -72,10 +79,13 @@ else
[ -z "$GITOLITE_HTTP_HOME" ] || [ -n "$admin_name" ] || die "looks like first run -- I need an admin name" [ -z "$GITOLITE_HTTP_HOME" ] || [ -n "$admin_name" ] || die "looks like first run -- I need an admin name"
cp $GL_PACKAGE_CONF/example.gitolite.rc $GL_RC cp $GL_PACKAGE_CONF/example.gitolite.rc $GL_RC
if [ -z "$quiet" ]
then
printf "The default settings in the "rc" file ($GL_RC) are fine for most\n" printf "The default settings in the "rc" file ($GL_RC) are fine for most\n"
printf "people but if you wish to make any changes, you can do so now.\n\nhit enter..." printf "people but if you wish to make any changes, you can do so now.\n\nhit enter..."
read i read i
${EDITOR:-vi} $GL_RC ${EDITOR:-vi} $GL_RC
fi
fi fi
# setup ssh stuff. We break our normal rule that we will not fiddle with # setup ssh stuff. We break our normal rule that we will not fiddle with