From b0052c7958db673bcf9d7a14103599c11e2b0513 Mon Sep 17 00:00:00 2001 From: Matthieu PETIOT Date: Wed, 4 Jul 2018 12:48:46 +0200 Subject: 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. --- plugins/perms/perms.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/perms/perms.plugin.zsh') diff --git a/plugins/perms/perms.plugin.zsh b/plugins/perms/perms.plugin.zsh index 7cdebab7f..1a7472c1c 100644 --- a/plugins/perms/perms.plugin.zsh +++ b/plugins/perms/perms.plugin.zsh @@ -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 -- cgit v1.2.3-70-g09d2