Fix df-related code
This commit is contained in:
		
							parent
							
								
									312f1e3da3
								
							
						
					
					
						commit
						0bd70d0d0f
					
				| @ -301,17 +301,18 @@ Common function between | ||||
| otherwise differ solely on the position of the mount point in the | ||||
| partition list. Its position is given by the argument | ||||
| MOUNT-POSITION." | ||||
|   (let ((partitions (split-string (eshell-info-banner--shell-command-to-string "df -lH") | ||||
|   (let ((partitions (cdr (split-string (eshell-info-banner--shell-command-to-string "df -lH") | ||||
|                                        (regexp-quote "\n") | ||||
|                                   t))) | ||||
|     (seq-filter (lambda (partition) | ||||
|                                        t)))) | ||||
|     (cl-remove-if #'null | ||||
|                   (mapcar (lambda (partition) | ||||
|                             (let* ((partition  (split-string partition " " t)) | ||||
|                                    (filesystem (nth 0 partition)) | ||||
|                                    (size       (nth 1 partition)) | ||||
|                                    (used       (nth 2 partition)) | ||||
|                                    (percent    (nth 4 partition)) | ||||
|                                    (mount      (nth mount-position partition))) | ||||
|                     (unless (seq-some (lambda (prefix) | ||||
|                               (when (seq-some (lambda (prefix) | ||||
|                                                 (string-prefix-p prefix filesystem t)) | ||||
|                                               eshell-info-banner-partition-prefixes) | ||||
|                                 (make-eshell-info-banner--mounted-partitions | ||||
| @ -322,7 +323,7 @@ MOUNT-POSITION." | ||||
|                                  :used used | ||||
|                                  :percent (string-to-number | ||||
|                                            (string-trim-left percent (regexp-quote "%"))))))) | ||||
|            partitions))) | ||||
|                           partitions)))) | ||||
| 
 | ||||
| (defun eshell-info-banner--get-mounted-partitions-gnu () | ||||
|   "Detect mounted partitions on a Linux system. | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user