Fix preview.sh not running when the file path contains "binary" (#1055)

This commit is contained in:
RichardNee
2020-06-21 16:54:35 +08:00
committed by GitHub
parent 8f1e73b598
commit 2bf85d25e2

View File

@@ -28,8 +28,9 @@ if [ ! -r "$FILE" ]; then
exit 1 exit 1
fi fi
FILE_LENGTH=${#FILE}
MIME=$(file --dereference --mime "$FILE") MIME=$(file --dereference --mime "$FILE")
if [[ "$MIME" =~ binary ]]; then if [[ "${MIME:FILE_LENGTH}" =~ binary ]]; then
echo "$MIME" echo "$MIME"
exit 0 exit 0
fi fi