mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: export run() to avoid Windows spawnSync issues (#431)
- session-end-marker.js now exports run() function - Enables in-process execution via run-with-flags.js - Avoids spawnSync cross-platform issues on Windows - Maintains backward compatibility with direct CLI execution Fixes #429 Co-authored-by: 阳虎 <yanghu@yanghudeMacBook-Pro.local>
This commit is contained in:
parent
b57b573085
commit
9fcbe9751c
1 changed files with 26 additions and 12 deletions
|
|
@ -1,6 +1,17 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Session end marker hook - outputs stdin to stdout unchanged.
|
||||||
|
* Exports run() for in-process execution (avoids spawnSync issues on Windows).
|
||||||
|
*/
|
||||||
|
|
||||||
|
function run(rawInput) {
|
||||||
|
return rawInput || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Legacy CLI execution (when run directly)
|
||||||
|
if (require.main === module) {
|
||||||
const MAX_STDIN = 1024 * 1024;
|
const MAX_STDIN = 1024 * 1024;
|
||||||
let raw = '';
|
let raw = '';
|
||||||
process.stdin.setEncoding('utf8');
|
process.stdin.setEncoding('utf8');
|
||||||
|
|
@ -13,3 +24,6 @@ process.stdin.on('data', chunk => {
|
||||||
process.stdin.on('end', () => {
|
process.stdin.on('end', () => {
|
||||||
process.stdout.write(raw);
|
process.stdout.write(raw);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { run };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue