]> gitweb.fluxo.info Git - metadot.git/commitdiff
Preparing to split metadot code from modules
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Dec 2013 16:31:06 +0000 (14:31 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 27 Dec 2013 16:31:06 +0000 (14:31 -0200)
README.mdwn
metadot

index 3b79850d88835dbdbe6c46fb1d1f64eb46ad22c1..901c8bebf3669de61e0d0327535ba385ffbc048e 100644 (file)
@@ -1,20 +1,34 @@
-Metadot: a dotfile management system
-====================================
+Metadot: modular dotfile management system
+==========================================
 
-Inspired by https://github.com/holman/dotfiles
+Metadot allows you to easilly manage and reuse existing dotfiles repositories
+by simply cloning then to your `~/.dotfiles/modules` and renaming a few files.
+
+By being modular, it's possible to create modules for specific applications
+(vim, mutt, emcas, git, etc). By using git submodules, one can even create her
+own dotfile bundle.
+
+Inspired by [holman does dotfiles](https://github.com/holman/dotfiles) and many
+other initiatives but with a modular design to ease dotfile sharing as the
+`metadot` code is split from the dotfile folder.
 
 Instalation
 -----------
 
 Get the code:
 
-    git clone --recursive git://URL/dotfiles.git .dotfiles
+    git clone --recursive git://git.sarava.org/metadot.git
+
+Save the metadot repository anywhere but make sure it's available in your `$PATH`.
+Then get some modules. You can get the whole standard module bundle with:
 
-Then add .dotfiles folder to your path or replace your dotfiles with
+    git clone --recursive git://git.sarava.org/rhatto/dotfiles.git ~/.dotfiles
 
-    ~/.dotfiles/metadot load profile
+This bundle will hardly suit all your needs. You can fetch individual modules or even
+start your own bundle:
 
-A backup will be saved.
+    mkdir -p ~/.dotfiles/modules
+    git clone --recursive git://git.sarava.org/rhatto/dotfiles/vim.git ~/.dotfiles/modules/vim
 
 Usage
 -----
@@ -31,12 +45,18 @@ Load all modules:
 
     metadot load --all
 
+Update a module bundle:
+
+    metadot update
+
+Backups are made whenever a module is loaded.
+
 Layout
 ------
 
 - ~/.dotfiles: where all dotfiles modules are stored
 - ~/.backups: backups of old config files
-- ~/.custom: your custom configuration where you can override parameters
+- ~/.custom: some modules use this folder where custom configuration can override default parameters
 
 Module format
 -------------
diff --git a/metadot b/metadot
index 3ba6c283b17845b74a63d82a227223eaeda1a2f0..47af6ac572ee9e5250a93c0242b0a5cf82968cd6 100755 (executable)
--- a/metadot
+++ b/metadot
@@ -80,7 +80,9 @@ elif [ "$OPT" == "ls" ]; then
 elif [ "$OPT" == "version" ]; then
   ( cd $DOT && git log -n 1 )
 elif [ "$OPT" == "update" ]; then
-  ( cd $DOT && git pull origin master && git submodule update --init )
+  if [ -d "$DOT/.git" ]; then
+    ( cd $DOT && git pull origin master && git submodule update --init )
+  fi
 elif [ "$OPT" == "backup" ]; then
   shift
   metadot_backup $1