From acfad0ca6a117341207f10a957e52deed38999c0 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Thu, 23 Aug 2012 12:08:24 +0200 Subject: .functions: Optimize `dataurl` Thanks to @lri: https://github.com/fin1te/dotfiles/commit/b8ce15ee91bc8658c27599347c376c30c6bfa1e1#commitcomment-1749202 --- .functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.functions') diff --git a/.functions b/.functions index 931bbf7..ddb0f82 100644 --- a/.functions +++ b/.functions @@ -13,7 +13,7 @@ fi # Create a data URL from a file function dataurl() { - local mimeType=$(file --mime-type "$1" | cut -d ' ' -f2) + local mimeType=$(file -b --mime-type "$1") if [[ $mimeType == text/* ]]; then mimeType="${mimeType};charset=utf-8" fi -- cgit v1.2.3