1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-07 16:00:41 +01:00

Add argument to set644 and set755 perms alias. (#6959)

This can avoid big mistakes as this I just made.
I thought I could give it an argument. So, now, it is possible.
This commit is contained in:
Matthieu PETIOT
2018-07-04 12:48:46 +02:00
committed by Marc Cornellà
parent dd8cf51397
commit b0052c7958
2 changed files with 9 additions and 5 deletions

View File

@@ -6,10 +6,14 @@
### Aliases
# Set all files' permissions to 644 recursively in a directory
alias set644='find . -type f ! -perm 644 -print0 | xargs -0 chmod 644'
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 ! -perm 755 -print0 | xargs -0 chmod 755'
set755() {
find "${@:-.}" -type d ! -perm 755 -print0 | xargs -0 chmod 755
}
### Functions