From 8f293bebc40c367793eac9c6af49c41c083c5533 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 7 Jun 2013 16:36:11 +0200 Subject: Create destination directory during a mkrc Allow for creating new tags when making a new rc file using `mkrc`. If you pass `-t foo` and `tag-foo` doesn't exist, it first makes it exist. --- bin/mkrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/mkrc b/bin/mkrc index e27570f..6cd2a2b 100755 --- a/bin/mkrc +++ b/bin/mkrc @@ -9,10 +9,10 @@ ROOT_DIR=$HOME destination() { - if [ $# -eq 1 ]; then - echo $DOTFILES/$1 + if [ $# -eq 0 ]; then + echo $DOTFILES else - echo $DOTFILES/tag-$2/$1 + echo $DOTFILES/tag-$2 fi } @@ -55,7 +55,8 @@ files=$@ for file in $files; do dotless=`echo $file | sed -e "s|$ROOT_DIR/||" | sed -e 's/^\.//'` - mkdir - $MV $file `destination $dotless $tag` + dest=`destination $dotless $tag` + mkdir -p $dest + $MV $file $dest/$dotless install_dotfile $dotless $tag done -- cgit v1.2.3