Skip to content

Commit

Permalink
Fix permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon authored Jun 26, 2024
1 parent ab80f38 commit 48f9532
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ async function recognize(_base64, lang, options) {
const { utils } = options;
const { run, cacheDir, osType, pluginDir } = utils;
let exeName = osType === "Windows_NT" ? "RapidOcrOnnx.exe" : "RapidOcrOnnx";

if (osType !== "Windows_NT") {
let res = await run('chmod', ['+x', `${pluginDir}/${exeName}`]);
}

let result = await run(`${pluginDir}/${exeName}`, [
"--models",
"models",
Expand Down Expand Up @@ -40,4 +45,4 @@ async function recognize(_base64, lang, options) {
} else {
throw Error(result.stderr);
}
}
}

0 comments on commit 48f9532

Please sign in to comment.