aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-01 01:32:03 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-02-01 01:32:03 -0200
commit6c5e43233130d8b12704f126ca80ceb7e226b5e2 (patch)
tree28754bdc0f0f162b9397991e70b6adccca44bc2e
parent6c4cf690242881f9e6c4931fbb16df064957a8b8 (diff)
downloaddotfiles-6c5e43233130d8b12704f126ca80ceb7e226b5e2.tar.gz
dotfiles-6c5e43233130d8b12704f126ca80ceb7e226b5e2.tar.bz2
Adding --all option to metadot load
-rwxr-xr-xmetadot19
1 files changed, 15 insertions, 4 deletions
diff --git a/metadot b/metadot
index 900e15f..f2bb2d7 100755
--- a/metadot
+++ b/metadot
@@ -66,9 +66,6 @@ function metadot_load {
ln -s $MODULES/$module/$file $HOME/$dirname/$destname
done
-
- echo "Backups saved at $BACKUPS."
-
else
echo "No such module $module"
fi
@@ -82,5 +79,19 @@ elif [ "$OPT" == "update" ]; then
( cd $DOT && git pull origin master && git submodule update --init )
elif [ "$OPT" == "load" ]; then
shift
- metadot_load $*
+
+ if [ -z "$1" ]; then
+ echo "usage: $BASENAME load [module(s)|--all]"
+ fi
+
+ if [ "$1" == "--all" ]; then
+ modules="`ls $MODULES`"
+ else
+ modules="$*"
+ fi
+
+ for module in $modules; do
+ metadot_load $module
+ done
+ echo "Backups saved at $BACKUPS."
fi