summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2013-07-27 20:19:32 -0400
committerGravatar Mike Burns <mike@mike-burns.com>2013-07-27 20:19:32 -0400
commitf369ef0805b3c0a6ad908e4e801c0c572b96716b (patch)
tree485d8748233da5add8b3e245b50dcd2fc76f20cc
parent74367c4d887c672a2cf5106107d074279828858c (diff)
Handle relative dotfiles directories
The `lsrc` command (and thus the other commands, too) now supports passing a relative directory name to `-d`. Previously, this caused only the non-host and non-tag directories to run; now all dotfiles directories are run for all metafiles, too. As an example, this now works correctly: lsrc -d dotfiles This still works, too: lsrc -d /home/mike/dotfiles
-rwxr-xr-xbin/lsrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/lsrc b/bin/lsrc
index 972f54f..766aa2f 100755
--- a/bin/lsrc
+++ b/bin/lsrc
@@ -150,6 +150,10 @@ fi
for DOTFILES_DIR in $DOTFILES_DIRS; do
+ if echo $DOTFILES_DIR | grep -vq '^/'; then
+ DOTFILES_DIR=$PWD/$DOTFILES_DIR
+ fi
+
if [ ! -d $DOTFILES_DIR ]; then
$VERBOSE "skipping non-existent directory: $DOTFILES_DIR"
continue