diff options
author | Mike Burns <mike@mike-burns.com> | 2013-06-07 16:36:11 +0200 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2013-06-07 16:36:11 +0200 |
commit | 8f293bebc40c367793eac9c6af49c41c083c5533 (patch) | |
tree | d13dcdc44f8499ee0a0e40bf81fdc27dbf54ff2e /bin | |
parent | 0ba9de9f37e50c73643d119c95cbe8a16bd5f82b (diff) |
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.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mkrc | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |