Skip to content

Commit e3ae8d0

Browse files
Merge pull request #4 from SolidLabResearch/fix/win-shell
fix: Make spawn process work on Windows
2 parents 9987eee + 99e1396 commit e3ae8d0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

demo/test-n3-engine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ex:zeno a foaf:Person.
5858

5959

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

8686
}
87-
main()
87+
main()

src/reasoner/EyeReasoner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export class EyeReasoner extends Reasoner {
4242
return new Promise<string>(async (resolve, reject) => {
4343
let errorData = '';
4444
let resultData = '';
45-
46-
const ls = spawn(this.eye, all_args);
45+
46+
const ls = spawn(this.eye, all_args, { shell: process.platform === 'win32' });
4747
ls.stdout.on('data', (data) => {
4848
resultData += data;
4949
});
@@ -62,4 +62,4 @@ export class EyeReasoner extends Reasoner {
6262
});
6363
});
6464
}
65-
}
65+
}

0 commit comments

Comments
 (0)