diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2009-07-28 03:10:53 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:12 -0600 |
commit | 9cc5fe6c84622c1c67566b03152ef55ccce2e4db (patch) | |
tree | ee16f7d9e17f9f3ebc1f054fce015ea2c420c021 /rvs.sh | |
parent | 87348edd1b6f1e0f79f76d0c95676214396a5fcd (diff) |
one mor commit before push
Diffstat (limited to 'rvs.sh')
-rw-r--r-- | rvs.sh | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -10,7 +10,6 @@ ver='0.7.0' # Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. RVSDIR='@rvsdir@' -REPO=`$RVSDIR/repo` error() { echo "$name: $1" >> /dev/stderr @@ -18,7 +17,7 @@ error() { } repo() { - repo='.rvs' + repo=".$name" pwd=`pwd` owd="$pwd" @@ -30,30 +29,31 @@ repo() { if [ -e "`pwd`/$repo" ]; then echo "`pwd`/$repo" else - echo "$name: no rvs repository found" >> /dev/stderr - exit 1 + error "no $name repository found" >> /dev/stderr fi cd "$owd" } - init() { - repo=`repo` + repo=`repo 2> /dev/null` if [ -z "$repo" ]; then - repo='.rvs' + repo=".$name" install -d "$repo" - fi - - if diff -q $RVSDIR/plugins $repo/plugins; then install -T $RVSDIR/plugins $repo/plugins while read plugin; do - if [ ! -e "$repo/$plugin" ]; then - install -d "$repo/$plugin" - if [ -e "$RVSDIR/$plugin/init" ]; then - $RVSDIR/$plugin/init - fi + echo "initializing plugin \`$plugin'" + echo 'foo0' + install -d "$repo/$plugin" + echo 'foo1' + export REPO=.rvs/$plugin + echo 'foo2' + if [ -e "$RVSDIR/$plugin/init" ]; then + $RVSDIR/$plugin/init fi + echo 'foo3' done < $repo/plugins + else + error "repository already exists at \`$repo'" fi } @@ -62,7 +62,7 @@ com=$1; # END OPTION HANDLING # case "$com" in '') error 'no command specified';; - 'repo') repo;; + 'repo') repo; exit $?;; 'init') init;; *) if [ -f "$RVSDIR/$com" ]; then @@ -73,7 +73,7 @@ case "$com" in while read plugin; do if [ -f "$RVSDIR/$plugin/$com" ]; then export RVSDIR=$RVSDIR/$plugin - export REPO=$REPO/$plugin + export REPO=`repo`/$plugin $RVSDIR/$@ done='yes' break |