]> ToastFreeware Gitweb - gregoa/movein.git/blobdiff - movein
Manage $MRCONFIG with `mr config'.
[gregoa/movein.git] / movein
diff --git a/movein b/movein
index a6a7bc43cdaec434bc3d92a843d80a2880a19748..ccdd709f49bce012f1217c0aacb8e8d70584d807 100755 (executable)
--- a/movein
+++ b/movein
@@ -17,6 +17,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 # USA.  
 
+
 set -e
 
 usage() {
@@ -39,7 +40,7 @@ SYNOPSIS
 
 COMMANDS
   init 
-      create ~/.mrconfig
+      create ~/.moveinrc, create/update  ~/.mrconfig
 
   ls
   list
@@ -77,11 +78,6 @@ init() {
        usage
     fi
     
-    if [ -e $MRCONFIG ]; then
-       echo $MRCONFIG already exists
-       exit 1
-    fi
-    
     if [ -e $MOVEINRC ]; then
        echo $MOVEINRC already exists
        exit 1
@@ -122,11 +118,7 @@ EOF
        mkdir -p "$LOCAL_REPOS"
     fi
 
-    cat <<END > $MRCONFIG
-[DEFAULT]
-include = cat /usr/share/mr/git-fake-bare
-END
-
+    mr -c "$MRCONFIG" config DEFAULT include="cat /usr/share/mr/git-fake-bare"
     
 }
 
@@ -164,13 +156,9 @@ add() {
        git config core.bare false
        GIT_WORK_TREE="$PWD" git pull
        trap - 0
-       cat <<END >> $MRCONFIG
 
-[$LOCAL_REPO]
-checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
-END
+       mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'"
     fi
-
 }
 
 list() {
@@ -208,19 +196,14 @@ new() {
        git config branch.master.merge refs/heads/master
        git config core.worktree ../../
        git config core.bare false
-#      for file in  ; do 
        export GIT_WORK_TREE="$PWD"
-           git add "$@"
-#      done
+       git add "$@"
        git commit -m "initial checkin"
        git push --all
        
        trap - 0
-       cat <<END >> $MRCONFIG
 
-[$LOCAL_REPO]
-checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
-END
+       mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'"
     fi
 
 }