}
-GIT_HOST=git.vireo.org
+GIT_HOST=git.$(hostname -d)
REMOTE_REPOS=~/git
LOCAL_REPOS=~/.movein
MRCONFIG=~/.mrconfig
exit 1
fi
- echo -n "git server hostname? [git.vireo.org] "
+ echo -n "git server hostname? [${GIT_HOST}] "
read GIT_HOST
if [ -z "$GIT_HOST" ]; then
- GIT_HOST=git.vireo.org
+ GIT_HOST=git.$(hostname -d)
fi
echo -n "path to remote repositories? [~/git] "
}
+preflight() {
+ # Check a few requirements before doing any work
+ errors=0
+ set +e
+ for binary in mr git; do
+ bin=$(which ${binary})
+ if [ -z "${bin}" ]; then
+ echo "Missing required program: ${binary}"
+ errors=$(( errors + 1 ))
+ fi
+ done
+ set -e
+ if [ $errors -ne 0 ]; then
+ echo "Errors found, exiting"
+ exit 2
+ fi
+}
+
if [ $# -lt 1 ]; then
usage
exit 1
init $@
;;
add)
+ preflight
add $@
;;
new)
+ preflight
new $@
;;
login)