diff options
| author | sigoden <sigoden@gmail.com> | 2025-02-10 14:47:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 14:47:37 +0800 |
| commit | fad2c60605b67a44dc6d242cd99f6f79f1bd4b13 (patch) | |
| tree | 1e09d16e378c273ad2d3668e329c80aeaf6d741c /scripts/run-tool.js | |
| parent | e4f85a056cdd2081374e3923af660942363f1133 (diff) | |
| download | llm-functions-docker-fad2c60605b67a44dc6d242cd99f6f79f1bd4b13.tar.gz | |
refactor: improve run-agent/run-agent scripts (#160)
Diffstat (limited to 'scripts/run-tool.js')
| -rwxr-xr-x | scripts/run-tool.js | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/run-tool.js b/scripts/run-tool.js index ea0b3a5..841fbc0 100755 --- a/scripts/run-tool.js +++ b/scripts/run-tool.js @@ -93,15 +93,10 @@ async function loadEnv(filePath) { } async function run(toolName, toolPath, toolFunc, toolData) { - let mod; if (os.platform() === "win32") { toolPath = `file://${toolPath}`; } - try { - mod = await import(toolPath); - } catch { - throw new Error(`Unable to load tool at '${toolPath}'`); - } + const mod = await import(toolPath); if (!mod || !mod[toolFunc]) { throw new Error(`Not module function '${toolFunc}' at '${toolPath}'`); } |
