Speed up cask pkg uninstallation when there's many directories to delete.
Results in an order of magnitude speedup for uninstalling large packages such as mactex.
This commit is contained in:
		
							parent
							
								
									571208c8ee
								
							
						
					
					
						commit
						23376bad75
					
				@ -110,6 +110,12 @@ module Cask
 | 
			
		||||
    RMDIR_SH = <<~'BASH'
 | 
			
		||||
      set -euo pipefail
 | 
			
		||||
 | 
			
		||||
      # Try removing as many empty directories as possible with a single
 | 
			
		||||
      # `rmdir` call to avoid or at least speed up the loop below.
 | 
			
		||||
      if /bin/rmdir -- "${@}" &>/dev/null; then
 | 
			
		||||
        exit
 | 
			
		||||
      fi
 | 
			
		||||
 | 
			
		||||
      for path in "${@}"; do
 | 
			
		||||
        symlink=true
 | 
			
		||||
        [[ -L "${path}" ]] || symlink=false
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user