From df9cf58ffff9557ae7a3bfef1db948d9c9412d35 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 7 Jun 2016 16:58:15 +0300 Subject: bugfix --- .README.md | 2 +- .bashrc | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.README.md b/.README.md index cc32ebd..c309786 100644 --- a/.README.md +++ b/.README.md @@ -29,7 +29,7 @@ repository. To adjust the permissions so that only you can read the files, `source` ".bashrc" (`bash` does this automatically) and execute: - adjust_dotfiles_permissions + cd && tighten_up_file_permissions_in_repo This also makes sure the directories in the repository are accessible only by yourself (including the ".git" directory). diff --git a/.bashrc b/.bashrc index b6a7378..cf2d13a 100644 --- a/.bashrc +++ b/.bashrc @@ -217,15 +217,20 @@ symlink_sublime_preferences() ( mkdir -p "$dest_dir" fi - find "$src_dir" -maxdepth 1 -type f -exec ln -fs {} "$dest_dir" \; + find "$src_dir" -maxdepth 1 -type f -exec ln --force -s {} "$dest_dir" \; ) tighten_up_file_permissions_in_repo() ( set -o errexit - git ls-files | xargs chmod 0600 + git ls-files -z | xargs -0 chmod 0600 - { echo . ; git ls-files ; } | xargs dirname | sort | uniq | tail -n +2 | xargs chmod 0700 + { printf '.\0' ; git ls-files -z ; } \ + | xargs -0 dirname -z \ + | sort -z \ + | uniq -z \ + | tail -z -n +2 \ + | xargs -0 chmod 0700 chmod 0700 .git ) -- cgit v1.2.3