diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-04-25 20:33:02 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-04-25 20:33:02 +0300 |
commit | fc3a25324c990eec7132ea68691c1e1f6882f704 (patch) | |
tree | b6c626039b3d3c80c691937521d1028d88799d7d | |
parent | adjust_dotfiles_permissions: recursively (diff) | |
download | linux-home-fc3a25324c990eec7132ea68691c1e1f6882f704.tar.gz linux-home-fc3a25324c990eec7132ea68691c1e1f6882f704.zip |
adjust_dotfiles_permissions: also directories
-rw-r--r-- | .bashrc | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -207,8 +207,20 @@ nwx_dev=172.28.12.149 nwx_dev2=172.28.19.60 nwx_dev3=172.28.19.61 +adjust_dotdirs_permissions() { + pushd ~ > /dev/null || return $? + { + git ls-files | xargs realpath | xargs dirname + realpath . + } | sort | uniq | grep --fixed-strings --invert-match --line-regex "$( realpath . )" | xargs chmod 0700 + popd > /dev/null +} + adjust_dotfiles_permissions() { - pushd ~ && git ls-tree -r HEAD | cut -f 2 | xargs chmod 0600 && popd + pushd ~ > /dev/null || return $? + adjust_dotdirs_permissions + git ls-tree -r HEAD | cut -f 2 | xargs chmod 0600 + popd > /dev/null } alias trim_trailing_whitespace='sed --binary --in-place '"'"'s/[[:blank:]]*\(\r\?\)$/\1/'"'" |