Do not preview binary files

This commit is contained in:
Junegunn Choi
2017-01-23 10:28:08 +09:00
parent 3e8ac82cbb
commit f54ec7caf1
2 changed files with 10 additions and 0 deletions

View File

@@ -22,6 +22,11 @@ if [ ! -r "$FILE" ]; then
exit 1
fi
if [[ "$(file --mime "$FILE")" =~ binary ]]; then
echo "$1 is a binary file"
exit 0
fi
if [ -z "$CENTER" ]; then
CENTER=1
fi