Skip to content

Commit e2c86c1

Browse files
author
Simeon F. Willbanks
committed
CentOS, and most likely other distros, do not have the --mime-type option for file. Here is the error: 'file: unrecognized option --mime-type'. The --mime option is more standard.
1 parent 77a3e77 commit e2c86c1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/docsplit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def self.extract_pdf(docs, opts={})
6565
basename = File.basename(doc, ext)
6666
escaped_doc, escaped_out, escaped_basename = [doc, out, basename].map(&ESCAPE)
6767

68-
if GM_FORMATS.include?(`file -b --mime-type #{doc}`.strip)
68+
if GM_FORMATS.include?(`file -b --mime #{doc}`.strip.split(/[:;]\s+/)[0])
6969
`gm convert #{escaped_doc} #{escaped_out}/#{escaped_basename}.pdf`
7070
else
7171
options = "-jar #{ROOT}/vendor/jodconverter/jodconverter-core-3.0-beta-3.jar -r #{ROOT}/vendor/conf/document-formats.js"

0 commit comments

Comments
 (0)