diff options
| author | Deposite Pirate | 2025-10-12 12:54:47 +0200 |
|---|---|---|
| committer | Deposite Pirate | 2025-10-12 12:54:47 +0200 |
| commit | 91c2f0ba73d041823fbd665c4baf60fef3cf9b32 (patch) | |
| tree | 557c451cac8f6b8379a0bb3bd66f867ce111d371 | |
| parent | 3942db2c9fa9e7afed2ff1cb5f54bed84501beb0 (diff) | |
Make rchmod more robust
Add default arguments.
modified: functions/rchmod.fish
| -rw-r--r-- | functions/rchmod.fish | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/functions/rchmod.fish b/functions/rchmod.fish index 8efbd40..63f64f0 100644 --- a/functions/rchmod.fish +++ b/functions/rchmod.fish @@ -5,9 +5,12 @@ if not command -sq 'find' return 1 end -if test (count $argv) -lt 2 - echo "Missing arguments." - return 1 +if test -z $dmode + set dmode '0755' +end + +if test -z $fmode + set fmode '0644' end find . -type d -exec chmod $dmode {} + |
