X-Git-Url: https://git.madduck.net/etc/mrsetup.git/blobdiff_plain/20976dd3b191408eb30f3e9608a98404fcf09bf1..8d723ff13bdbfacff2ae2f1847512bdec36bbd55:/mrsetup diff --git a/mrsetup b/mrsetup index 5af4833..275ec3a 100755 --- a/mrsetup +++ b/mrsetup @@ -5,7 +5,7 @@ # Copyright © 2008 martin f. krafft # Released under the terms of the Artistic Licence 2.0 # -set -eu +set -u MY_GIT_SERVER=git.madduck.net MY_GIT_REPOS='~/git' @@ -19,24 +19,29 @@ MR_FGIT=.fgits/mr.git MR=.mr BIN_DIR=.bin +if [ -z "${SSH_AUTH_SOCK:-}" ]; then + echo E: '$SSH_AUTH_SOCK' is not set. >&2 + exit 1 +fi + if [ ! -x "$(command -v git)" ]; then echo E: git is not installed. >&2 - exit 1 + exit 2 fi if [ -e .mrconfig ]; then echo E: .mrconfig already exists. >&2 - exit 2 + exit 3 fi if [ -d "$MR_FGIT" ]; then echo E: "$MR_FGIT" already exists. >&2 - exit 3 + exit 4 fi if [ -d ".git" ]; then echo E: .git already exists. >&2 - exit 3 + exit 5 fi if [ -d code/mr ]; then @@ -44,7 +49,7 @@ if [ -d code/mr ]; then echo W: code/mr already exists, let us hope for the best... >&2 else echo E: code/mr already exists. >&2 - exit 4 + exit 6 fi else echo I: cloning mr into ${MR_CODE}... @@ -96,6 +101,14 @@ else git add .mrconfig git commit -m'initial checkin' git push --all + echo fi +[ -f "$0" ] && rm $0 || : + +echo I: spawning a shell... +$SHELL --interactive --login + +echo I: back from the shell. + exit 0