aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDeposite Pirate2025-10-12 12:51:16 +0200
committerDeposite Pirate2025-10-12 12:51:16 +0200
commit3942db2c9fa9e7afed2ff1cb5f54bed84501beb0 (patch)
treea37860c54ae0e565e3591a3b8f8d906fd60211e4 /functions
parentd867f5a4dc8b2612cb1499b6de942d58e6c6fd63 (diff)
Make rchmod more useful
Allow specifying mode of directories and files. modified: functions/rchmod.fish
Diffstat (limited to 'functions')
-rw-r--r--functions/rchmod.fish13
1 files changed, 9 insertions, 4 deletions
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