From 03fdeb451b3bf1c63e3f2a725bf9bdb8e137f0a7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 27 Dec 2013 14:31:06 -0200 Subject: Preparing to split metadot code from modules --- README.mdwn | 36 ++++++++++++++++++++++++++++-------- metadot | 4 +++- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/README.mdwn b/README.mdwn index 3b79850..901c8be 100644 --- a/README.mdwn +++ b/README.mdwn @@ -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 3ba6c28..47af6ac 100755 --- 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 -- cgit v1.2.3