File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,13 @@ mkdir -p build
16
16
17
17
# Build for different platforms
18
18
echo " Building for Linux x64..."
19
- deno compile --allow-sys --allow-read --allow-write --target x86_64-unknown-linux-gnu --output build/scribe-linux-x64 cli/scribe.js
20
- # deno compile --allow-sys --allow-read --allow-write --target x86_64-unknown-linux-gnu --output build/scribe-linux-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
19
+ deno compile --allow-sys --allow-read --allow-write --target x86_64-unknown-linux-gnu --output build/scribe-linux-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
21
20
22
21
echo " Building for macOS x64..."
23
- deno compile --allow-sys --allow-read --allow-write --target x86_64-apple-darwin --output build/scribe-macos-x64 cli/scribe.js
24
- # deno compile --allow-sys --allow-read --allow-write --target x86_64-apple-darwin --output build/scribe-macos-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
22
+ deno compile --allow-sys --allow-read --allow-write --target x86_64-apple-darwin --output build/scribe-macos-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
25
23
26
24
echo " Building for Windows x64..."
27
- deno compile --allow-sys --allow-read --allow-write --target x86_64-pc-windows-msvc --output build/scribe-windows-x64.exe cli/scribe.js
28
- # deno compile --allow-sys --allow-read --allow-write --target x86_64-pc-windows-msvc --output build/scribe-windows-x64.exe --include mupdf --include fonts --include js/worker cli/scribe.js
25
+ deno compile --allow-sys --allow-read --allow-write --target x86_64-pc-windows-msvc --output build/scribe-windows-x64.exe --include mupdf --include fonts --include js/worker cli/scribe.js
29
26
30
27
# Create checksums
31
28
cd build
Original file line number Diff line number Diff line change @@ -77,7 +77,6 @@ async function main(func, params) {
77
77
if ( scribe . opt . displayMode === 'proof' ) {
78
78
outputSuffix = '_vis' ;
79
79
} else if ( scribe . opt . displayMode === 'invis' ) {
80
-
81
80
// Check if output file would overwrite any input file, and if so, add a suffix to avoid overwriting.
82
81
// This software is still in development--nobody should be ovewriting input files.
83
82
const resolvedOutputFileTmp = path . resolve ( `${ outputDir } /${ outputStem } .pdf` ) ;
Original file line number Diff line number Diff line change @@ -170,12 +170,14 @@ export async function sortInputFiles(files) {
170
170
// Notably, (1) this only works for Textract JSON files stored in specific object types, and
171
171
// (2) this reads the file content as text and then discards it after checking the content,
172
172
// which is not ideal for performance.
173
- if ( [ '' ] . includes ( fileExt ) && typeof process === 'undefined' && file instanceof File ) {
174
- const content = await readTextFile ( file ) ;
175
- if ( / " A n a l y z e D o c u m e n t M o d e l V e r s i o n " / i. test ( content ) ) {
176
- ocrFilesAll . push ( file ) ;
177
- continue ;
178
- }
173
+ if ( [ '' ] . includes ( fileExt ) ) {
174
+ try {
175
+ const content = await readOcrFile ( file ) ;
176
+ if ( / " A n a l y z e D o c u m e n t M o d e l V e r s i o n " / i. test ( content ) ) {
177
+ ocrFilesAll . push ( file ) ;
178
+ continue ;
179
+ }
180
+ } catch ( error ) { /* empty */ }
179
181
}
180
182
181
183
unsupportedFilesAll . push ( file ) ;
You can’t perform that action at this time.
0 commit comments