From 48f9532ae25460ff74641c3f58082fdec85eec29 Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Wed, 26 Jun 2024 16:53:09 +0800 Subject: [PATCH] Fix permission issues --- main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index debd666..9418a21 100644 --- a/main.js +++ b/main.js @@ -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", @@ -40,4 +45,4 @@ async function recognize(_base64, lang, options) { } else { throw Error(result.stderr); } -} \ No newline at end of file +}