Skip to content

fix: Make spawn process work on Windows #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demo/test-n3-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ex:zeno a foaf:Person.


const eyeJs = new EyeJsReasoner()
const eye = new EyeReasoner('/usr/local/bin/eye', ["--quiet", "--nope", "--pass-only-new"])
const eye = new EyeReasoner('eye', ["--quiet", "--nope", "--pass-only-new"])
const ruleDir = path.join(path.dirname(__filename), "..", "src", "rules");
const rulePath = path.join(ruleDir, "simpleRules.n3");
const rules = fs.readFileSync(rulePath, "utf-8");
Expand All @@ -84,4 +84,4 @@ async function main() {
console.log(storeToString(new Store(reasoningResultLocal)));

}
main()
main()
6 changes: 3 additions & 3 deletions src/reasoner/EyeReasoner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class EyeReasoner extends Reasoner {
return new Promise<string>(async (resolve, reject) => {
let errorData = '';
let resultData = '';
const ls = spawn(this.eye, all_args);

const ls = spawn(this.eye, all_args, { shell: process.platform === 'win32' });
ls.stdout.on('data', (data) => {
resultData += data;
});
Expand All @@ -62,4 +62,4 @@ export class EyeReasoner extends Reasoner {
});
});
}
}
}