From 3942db2c9fa9e7afed2ff1cb5f54bed84501beb0 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Sun, 12 Oct 2025 12:51:16 +0200 Subject: Make rchmod more useful Allow specifying mode of directories and files. modified: functions/rchmod.fish --- functions/rchmod.fish | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'functions/rchmod.fish') diff --git a/functions/rchmod.fish b/functions/rchmod.fish index b54348f..8efbd40 100644 --- a/functions/rchmod.fish +++ b/functions/rchmod.fish @@ -1,11 +1,16 @@ -function rchmod --description 'Recursively reset premissions of files and folders' +function rchmod --description 'Recursively reset perms of files and folders' -a dmode -a fmode if not command -sq 'find' echo "Can't find find." - return 1 + return 1 end -find . -type d -exec chmod 755 {} + -find . -type f -exec chmod 644 {} + +if test (count $argv) -lt 2 + echo "Missing arguments." + return 1 +end + +find . -type d -exec chmod $dmode {} + +find . -type f -exec chmod $fmode {} + end -- cgit v1.3.1