Skip to content

Commit 1794667

Browse files
committed
Updated CLI and deno build
1 parent ac550c2 commit 1794667

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

build-deno-compile.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +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 --include mupdf --include fonts --include js/worker cli/scribe.js
19+
deno compile --allow-sys --allow-read --allow-net --allow-write --target x86_64-unknown-linux-gnu --output build/scribe-linux-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
2020

2121
echo "Building for macOS x64..."
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
22+
deno compile --allow-sys --allow-read --allow-net --allow-write --target x86_64-apple-darwin --output build/scribe-macos-x64 --include mupdf --include fonts --include js/worker cli/scribe.js
2323

2424
echo "Building for Windows x64..."
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
25+
deno compile --allow-sys --allow-read --allow-net --allow-write --target x86_64-pc-windows-msvc --output build/scribe-windows-x64.exe --include mupdf --include fonts --include js/worker cli/scribe.js
2626

2727
# Create checksums
2828
cd build

cli/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ export const overlay = async (files, outputDir, options) => (main('overlay', {
165165
*
166166
* @param {string[]} files - Paths to input files.
167167
* @param {Object} options
168+
* @param {string} [options.output]
168169
* @param {"eval" | "ebook" | "proof" | "invis"} [options.overlayMode]
169170
* @param {boolean} [options.hocr]
170171
* @param {number} [options.workers]
171172
*/
172173
export const recognize = async (files, options) => (main('recognize', {
173-
files, overlayMode: options?.overlayMode || 'invis', workerN: options?.workers, hocr: options?.hocr,
174+
files, overlayMode: options?.overlayMode || 'invis', workerN: options?.workers, hocr: options?.hocr, outputDir: options?.output || '.',
174175
}));
175176

176177
/**

cli/scribe.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ program
5454

5555
program
5656
.command('recognize')
57-
.description('Recognize text in PDF file using internal OCR engine.')
57+
.option('-o, --output <directory>', 'Directory for output file(s). Default is current directory.')
5858
.option('-v, --vis', 'Print OCR text visibly over provided PDF file with colors coded by confidence.')
5959
.option('-h, --hocr', 'Output .hocr intermediate data in addition to .pdf.')
6060
.option('-w, --workers <number>', 'Number of workers to use. Default is up to 8.')
6161
.argument('<files...>', 'Input PDF file and OCR file(s). Accepts .hocr and Abbyy .xml (with character-level data enabled).')
62+
.description('Recognize text in PDF file using internal OCR engine.')
6263
.action(recognizeCLI);
6364

6465
program

0 commit comments

Comments
 (0)