From b18e7ac2372be1f55c7f163a991575cd03a3e899 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 30 Mar 2024 14:28:04 -0400 Subject: [PATCH] FIX mime type bugs --- etc/conf.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/conf.org b/etc/conf.org index 5f2ffcd..43281b9 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -302,9 +302,10 @@ desktop file exec directive." (defun nd/get-mime-type (file) "Get the mime type of FILE." - (let* ((cmd (format "file --mime-type -b '%s'" file)) - (mt (shell-command-to-string cmd))) - (replace-regexp-in-string "\n\\'" "" mt))) + (->> (shell-quote-argument file) + (format "file --mime-type -b %s") + (shell-command-to-string) + (s-trim))) (defconst nd/device-mount-dirs (list