From ae5c63b653aaa60ca15e83e821c47802578d0814 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 30 Jul 2023 19:19:58 +0530 Subject: ctov: fix: plain and application mime prefix on different $file implementation --- bin/ctov.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/ctov.sh b/bin/ctov.sh index 018b70c..10b8d33 100755 --- a/bin/ctov.sh +++ b/bin/ctov.sh @@ -69,9 +69,11 @@ while getopts "hf:" f; do esac done -if [ -n "$file" ] && - [ "$(file --brief --dereference --mime-type "$file")" != "application/csv" ]; then - die "input is not a csv file" +if [ -n "$file" ]; then + case "$(file --brief --dereference --mime-type "$file")" in + *"/csv") ;; + *) die "input is not a csv file" ;; + esac fi while read -r entry; do -- cgit v1.2.3