Skip to content

Commit ac550c2

Browse files
committed
Fixed missing files in compiled version
1 parent 5fc78c9 commit ac550c2

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

build-deno-compile.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ mkdir -p build
1616

1717
# Build for different platforms
1818
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
2120

2221
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
2523

2624
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
2926

3027
# Create checksums
3128
cd build

cli/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ async function main(func, params) {
7777
if (scribe.opt.displayMode === 'proof') {
7878
outputSuffix = '_vis';
7979
} else if (scribe.opt.displayMode === 'invis') {
80-
8180
// Check if output file would overwrite any input file, and if so, add a suffix to avoid overwriting.
8281
// This software is still in development--nobody should be ovewriting input files.
8382
const resolvedOutputFileTmp = path.resolve(`${outputDir}/${outputStem}.pdf`);

js/import/import.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ export async function sortInputFiles(files) {
170170
// Notably, (1) this only works for Textract JSON files stored in specific object types, and
171171
// (2) this reads the file content as text and then discards it after checking the content,
172172
// which is not ideal for performance.
173-
if ([''].includes(fileExt) && typeof process === 'undefined' && file instanceof File) {
174-
const content = await readTextFile(file);
175-
if (/"AnalyzeDocumentModelVersion"/i.test(content)) {
176-
ocrFilesAll.push(file);
177-
continue;
178-
}
173+
if ([''].includes(fileExt)) {
174+
try {
175+
const content = await readOcrFile(file);
176+
if (/"AnalyzeDocumentModelVersion"/i.test(content)) {
177+
ocrFilesAll.push(file);
178+
continue;
179+
}
180+
} catch (error) { /* empty */ }
179181
}
180182

181183
unsupportedFilesAll.push(file);

0 commit comments

Comments
 (0)