aboutsummaryrefslogtreecommitdiff
path: root/functions/rchmod.fish
blob: 63f64f0207d8cc07bc88df56c49d43de28c86cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
end

if test -z $dmode
  set dmode '0755'
end

if test -z $fmode
  set fmode '0644'
end

find . -type d -exec chmod $dmode {} +
find . -type f -exec chmod $fmode {} +

end