Skip to content
Closed
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
15 changes: 14 additions & 1 deletion tests/hermes-plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@ const skillCommands = commands.filter((name) => name !== 'ponytail');

const root = path.join(__dirname, '..');

// ponytail: probe once; on Windows `python3` is the Store-alias stub that fails
// even when Python is installed, so fall back to `python` (mirrors benchmarks/correctness.js).
let pythonCmd;
function pythonExe() {
if (pythonCmd) return pythonCmd;
for (const cmd of ['python3', 'python']) {
if (spawnSync(cmd, ['-c', 'import sys'], { encoding: 'utf8' }).status === 0) {
return (pythonCmd = cmd);
}
}
return (pythonCmd = 'python3');
}

function python(script, env = {}) {
const result = spawnSync('python3', ['-c', script], {
const result = spawnSync(pythonExe(), ['-c', script], {
cwd: root,
env: { ...process.env, ...env },
encoding: 'utf8',
Expand Down
Loading