summaryrefslogtreecommitdiff
path: root/plugins/perms/perms.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-21 12:36:09 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-21 12:36:09 -0600
commite3a28817b0a7ee5724884d9c132763af4a64182c (patch)
tree094a2e25f2efa94a922750b76643dacba7ace598 /plugins/perms/perms.plugin.zsh
parent2d833d0b20726f58e8776a7158aaa7eca05d5ee9 (diff)
parent973c92cd91d595fde37a4dbd5a6389072654252f (diff)
downloadzsh-e3a28817b0a7ee5724884d9c132763af4a64182c.tar.gz
zsh-e3a28817b0a7ee5724884d9c132763af4a64182c.tar.bz2
zsh-e3a28817b0a7ee5724884d9c132763af4a64182c.zip
merge agnoster theme
Diffstat (limited to 'plugins/perms/perms.plugin.zsh')
-rw-r--r--plugins/perms/perms.plugin.zsh12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/perms/perms.plugin.zsh b/plugins/perms/perms.plugin.zsh
index 81f56d577..7cdebab7f 100644
--- a/plugins/perms/perms.plugin.zsh
+++ b/plugins/perms/perms.plugin.zsh
@@ -6,10 +6,10 @@
### Aliases
# Set all files' permissions to 644 recursively in a directory
-alias set644='find . -type f -print0 | xargs -0 chmod 644'
+alias set644='find . -type f ! -perm 644 -print0 | xargs -0 chmod 644'
# Set all directories' permissions to 755 recursively in a directory
-alias set755='find . -type d -print0 | xargs -0 chmod 755'
+alias set755='find . -type d ! -perm 755 -print0 | xargs -0 chmod 755'
### Functions
@@ -63,14 +63,14 @@ EOF
exit_status=0;
if [[ $use_slow == true ]]; then
# Process directories first so non-traversable ones are fixed as we go
- find "$target" -type d -exec chmod $chmod_opts 755 {} \;
+ find "$target" -type d ! -perm 755 -exec chmod $chmod_opts 755 {} \;
if [[ $? != 0 ]]; then exit_status=$?; fi
- find "$target" -type f -exec chmod $chmod_opts 644 {} \;
+ find "$target" -type f ! -perm 644 -exec chmod $chmod_opts 644 {} \;
if [[ $? != 0 ]]; then exit_status=$?; fi
else
- find "$target" -type d -print0 | xargs -0 chmod $chmod_opts 755
+ find "$target" -type d ! -perm 755 -print0 | xargs -0 chmod $chmod_opts 755
if [[ $? != 0 ]]; then exit_status=$?; fi
- find "$target" -type f -print0 | xargs -0 chmod $chmod_opts 644
+ find "$target" -type f ! -perm 644 -print0 | xargs -0 chmod $chmod_opts 644
if [[ $? != 0 ]]; then exit_status=$?; fi
fi
echo "Complete"