Explorar o código

Optimize fixperms by using one find loop and passing all paths in one go
instead of one by one

Piotr Kwiecinski %!s(int64=4) %!d(string=hai) anos
pai
achega
6bd1609aba
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      compose/bin/fixperms

+ 2 - 4
compose/bin/fixperms

@@ -2,12 +2,10 @@
 echo "Correcting filesystem permissions..."
 
 if [ -z "$1" ]; then
-  bin/clinotty find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
-  bin/clinotty find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
+  bin/clinotty find var vendor pub/static pub/media app/etc \( -type f -or -type d \) -exec chmod u+w {} +;
   bin/clinotty chmod u+x bin/magento
 else
-  bin/clinotty find $1 -type f -exec chmod u+w {} \;
-  bin/clinotty find $1 -type d -exec chmod u+w {} \;
+  bin/clinotty find "$1" \( -type f -or -type d \) -exec chmod u+w {} +;
 fi
 
 echo "Filesystem permissions corrected."