Permalink
Browse files

.functions: Optimize `dataurl`

  • Loading branch information...
1 parent 966756f commit acfad0ca6a117341207f10a957e52deed38999c0 @mathiasbynens committed Aug 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 .functions
View
@@ -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

0 comments on commit acfad0c

Please sign in to comment.