summaryrefslogtreecommitdiff
path: root/rvs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rvs.sh')
-rw-r--r--rvs.sh34
1 files changed, 17 insertions, 17 deletions
diff --git a/rvs.sh b/rvs.sh
index 88c4a9b..d020b90 100644
--- a/rvs.sh
+++ b/rvs.sh
@@ -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