Skip to content

Commit

Permalink
easy install: some minor fixes
Browse files Browse the repository at this point in the history
  - fix typo in introduction
  - detect if you're not running strictly as src/00-easy-install.sh
  • Loading branch information
Sitaram Chamarty committed Oct 12, 2009
1 parent 0b81bfd commit 48e18e1
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/00-easy-install.sh
Expand Up @@ -15,7 +15,7 @@
# command!)
set -e

die() { echo "$@"; echo "run $0 again without any arguments for help and tips"; exit 1; }
die() { echo "$@"; echo; echo "run $0 again without any arguments for help and tips"; exit 1; }
prompt() {
echo
echo
Expand Down Expand Up @@ -47,7 +47,7 @@ Notes:
Pre-requisites:
- you must run this from the gitolite working tree top level directory.
This means you run this as "src/00-easy-install-clientside.sh"
This means you run this as "src/00-easy-install.sh"
- you must already have pubkey based access to user@host. If you currently
only have password access, use "ssh-copy-id" or something. Somehow get to
the point where you can type "ssh user@host" and get a command line. Run
Expand All @@ -62,6 +62,23 @@ EOFU
exit 1;
}

# ----------------------------------------------------------------------
# basic sanity / argument checks
# ----------------------------------------------------------------------

# MANUAL: this *must* be run as "src/00-easy-install.sh", not by cd-ing to src
# and then running "./00-easy-install.sh"

[[ $0 =~ ^src/00-easy-install.sh$ ]] ||
{
echo "please cd to the gitolite repo top level directory and run this as
'src/00-easy-install.sh'"
exit 1;
}

# MANUAL: (info) we'll use "git" as the user, "server" as the host, and
# "sitaram" as the admin_name in example commands shown below, if any

[[ -z $3 ]] && usage
user=$1
host=$2
Expand All @@ -78,13 +95,6 @@ port=22
[[ "$user" =~ [^a-zA-Z0-9._-] ]] && die "user '$user' invalid"
[[ "$admin_name" =~ [^a-zA-Z0-9._-] ]] && die "admin_name '$admin_name' invalid"

# MANUAL: (info) we'll use "git" as the user, "server" as the host, and
# "sitaram" as the admin_name in example commands shown below, if any

# ----------------------------------------------------------------------
# basic sanity checks
# ----------------------------------------------------------------------

# MANUAL: make sure you're in the gitolite directory, at the top level.
# The following files should all be visible:

Expand Down

0 comments on commit 48e18e1

Please sign in to comment.