diff options
author | Mike Burns <mike@mike-burns.com> | 2014-02-27 16:52:06 +0100 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2014-02-27 16:52:06 +0100 |
commit | 2168cfa113ef394cf6597d1c5d81db8a7fa00ebe (patch) | |
tree | 86f149e7c35a54f721b886599586e0545f5abbb2 /bin/lsrc | |
parent | 4362934dbfe3178e59493962271627f117e4ab6c (diff) |
Quote the PWD
This allows for users to run this command from within directories that
have spaces in their path.
I've also quoted `DOTFILES_DIR` in more places, but this is so far a
waste: we still don't support dotfiles directories with spaces in their
name.
Diffstat (limited to 'bin/lsrc')
-rwxr-xr-x | bin/lsrc | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -270,16 +270,16 @@ $DEBUG "COPY_ALWAYS: $COPY_ALWAYS" : ${SYMLINK_DIRS:=""} $DEBUG "SYMLINK_DIRS: $SYMLINK_DIRS" -relative_root_dir=$PWD +relative_root_dir="$PWD" for DOTFILES_DIR in $DOTFILES_DIRS; do - cd $relative_root_dir + cd "$relative_root_dir" if is_relative $DOTFILES_DIR; then DOTFILES_DIR=$PWD/$DOTFILES_DIR fi - if [ ! -d $DOTFILES_DIR ]; then + if [ ! -d "$DOTFILES_DIR" ]; then $VERBOSE "skipping non-existent directory: $DOTFILES_DIR" continue fi @@ -290,7 +290,7 @@ for DOTFILES_DIR in $DOTFILES_DIRS; do symlink_dirs_file_globs=`dotfiles_dir_excludes $DOTFILES_DIR "$SYMLINK_DIRS"` $DEBUG "symlink_dirs_file_globs: $symlink_dirs_file_globs" - cd $DOTFILES_DIR + cd "$DOTFILES_DIR" DIR_STACK=":$DOTFILES_DIR" for file in ${FILES:-*}; do @@ -301,7 +301,7 @@ for DOTFILES_DIR in $DOTFILES_DIRS; do handle_file $file $DEST_DIR $DOTFILES_DIR . 0 "$exclude_file_globs" "$include_file_globs" "$symlink_dirs_file_globs" done - cd $DOTFILES_DIR + cd "$DOTFILES_DIR" host_files=$DOTFILES_DIR/host-$HOSTNAME if [ -d $host_files ]; then @@ -312,7 +312,7 @@ for DOTFILES_DIR in $DOTFILES_DIRS; do popdir fi - cd $DOTFILES_DIR + cd "$DOTFILES_DIR" for tag in $TAGS; do if [ -d tag-$tag ]; then |